Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.internal.grid
Class CollectionGridDataSource

    java.lang.Object
      org.apache.tapestry5.internal.grid.CollectionGridDataSource

All Implemented Interfaces:
  GridDataSource

    public class CollectionGridDataSource

extends java.lang.Object
implements GridDataSource

Constructor Summary
`CollectionGridDataSource(java.util.Collection collection)`

Method Summary
`int` | `getAvailableRows()` Returns the number of rows available in the data source.
`java.lang.Class` | `getRowType()` Returns the type of the first element in the list, or null if the list is empty.
`java.lang.Object` | `getRowValue(int index)` Returns the row value at the provided index.
`void` | `prepare(int startIndex, int endIndex, java.util.List<SortConstraint> sortConstraints)` Invoked to allow the source to prepare to present values.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CollectionGridDataSource

    public CollectionGridDataSource(java.util.Collection collection)

Method Detail

### getAvailableRows

    public int getAvailableRows()

  Description copied from interface: `GridDataSource`
  Returns the number of rows available in the data source.

  Specified by:
    `getAvailableRows` in interface `GridDataSource`

### prepare

    public void prepare(int startIndex,
                        int endIndex,
                        java.util.List<SortConstraint> sortConstraints)

  Description copied from interface: `GridDataSource`
  Invoked to allow the source to prepare to present values. This gives the source a chance to pre-fetch data (when appropriate) and informs the source of the desired sort order. Sorting comes first, then extraction by range.

  Specified by:
    `prepare` in interface `GridDataSource`
  Parameters:
    `startIndex` - the starting index to be retrieved
    `endIndex` - the ending index to be retrieved
    `sortConstraints` - identify how data is to be sorted

### getRowType

    public java.lang.Class getRowType()

  Returns the type of the first element in the list, or null if the list is empty.

  Specified by:
    `getRowType` in interface `GridDataSource`
  Returns:
    the row type, or null

### getRowValue

    public java.lang.Object getRowValue(int index)

  Description copied from interface: `GridDataSource`
  Returns the row value at the provided index. This method will be invoked in sequential order. In rare instances, `GridDataSource.getAvailableRows()` may return a different number of rows than are actually available (i.e., the database was changed between calls to `GridDataSource.getAvailableRows()` and the call to `GridDataSource.prepare(int, int, java.util.List)`). In that case, this method should return null for any out-of-range indexes.

  Specified by:
    `getRowValue` in interface `GridDataSource`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.