com.crystaldecisions.sdk.occa.report.gridcontent
Class GridColumnCollection

java.lang.Object
  |
  +--com.crystaldecisions.sdk.occa.report.gridcontent.GridColumnCollection

public class GridColumnCollection
extends java.lang.Object

The GridColumnCollection class provides the ability to form a collection of GridColumn objects. The collection can then be used in conjunction with the GridViewer.


Constructor Summary
GridColumnCollection()
           
 
Method Summary
 void add(GridColumn newGridColumn)
          Adds an existing grid column to the GridColumnCollection.
 GridColumn add(java.lang.String fieldName)
          Adds a new grid column to the GridColumnCollection.
 void clear()
          Clears the GridColumns in the GridColumnCollection.
 GridColumn get(int index)
          Returns the GridColumn at the specified index in the collection.
 void remove(int index)
          Removes the GridColumn identified by the given index from the collection.
 void remove(java.lang.String fieldName)
          Removes the GridColumn identified by the given field name from the collection.
 int size()
          Returns the size of the collection (in number of columns).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridColumnCollection

public GridColumnCollection()
Method Detail

add

public GridColumn add(java.lang.String fieldName)

Adds a new grid column to the GridColumnCollection.

Note:The AddGridColumn method accepts a String representing the Field name of the GridColumn Object to add to the collection. Every GridColumn Object has a FieldName property, the value of which is the String passed to the AddGridColumn method.

Parameters:
fieldName - a String that specifies the name of the field for the column to be added to the collection
Returns:
a new GridColumn object

add

public void add(GridColumn newGridColumn)

Adds an existing grid column to the GridColumnCollection.

Parameters:
newGridColumn - an existing GridColumn object to be added to the collection

clear

public void clear()

Clears the GridColumns in the GridColumnCollection.


get

public GridColumn get(int index)

Returns the GridColumn at the specified index in the collection.

Parameters:
index - an int that specifies the 0-based index to use to identify the GridColumn to retrieve
Returns:
a GridColumn object

remove

public void remove(java.lang.String fieldName)

Removes the GridColumn identified by the given field name from the collection.

Parameters:
fieldName - a String that identifies the GridColumn to be removed from the collection

remove

public void remove(int index)
            throws java.lang.IndexOutOfBoundsException

Removes the GridColumn identified by the given index from the collection.

Parameters:
index - an int that specifies the 0-based index to use to identify the GridColumn to remove
Throws:
java.lang.IndexOutOfBoundsException - this exception is thrown if the given index is out of bounds for the collection

size

public int size()

Returns the size of the collection (in number of columns).

Returns:
the size of the collection as an int