org.apache.myfaces.trinidad.model
Interface RowKeyIndex

All Known Subinterfaces:
CollectionComponent
All Known Implementing Classes:
BaseMenuModel, ChildPropertyMenuModel, ChildPropertyTreeModel, CollectionModel, CollectionModelDecorator, CoreBreadCrumbs, CoreNavigationPane, CoreNavigationTree, CorePage, CoreProcessChoiceBar, CoreTable, CoreTrain, CoreTree, CoreTreeTable, MenuModel, ProcessMenuModel, RowKeyPropertyModel, RowKeyPropertyTreeModel, SortableModel, TreeModel, TreeModelDecorator, UIXHierarchy, UIXMenuHierarchy, UIXNavigationHierarchy, UIXNavigationLevel, UIXNavigationPath, UIXNavigationTree, UIXPage, UIXProcess, UIXTable, UIXTree, UIXTreeTable, ViewIdPropertyMenuModel, XMLMenuModel

public interface RowKeyIndex

Identifies a collection that is indexed by rowKeys. Data is accessed by setting a rowKey, and then accessing getRowData().


Method Summary
 boolean areRowsAvailable(int rowsToCheck)
          Check if a range of rows is available starting from the current position
 boolean areRowsAvailable(int startIndex, int rowsToCheck)
          Check if a range of rows is available from a starting index without requiring the client to iterate over the rows
 boolean areRowsAvailable(Object startRowKey, int rowsToCheck)
          Check if a range of rows is available from a starting row key without requiring the client to iterate over the rows
 int getRowCount()
          Gets the number of values in this collection
 Object getRowData()
          Gets the current value identified by the current index or rowKey.
 Object getRowData(int rowIndex)
          Gets the row value at the given index.
 Object getRowData(Object rowKey)
          Get row data by row key.
 int getRowIndex()
          Gets the index of the current value.
 Object getRowKey()
          Gets the rowKey of the current value.
 boolean isRowAvailable()
          Checks to make sure a value exists for the current index or rowKey.
 boolean isRowAvailable(int rowIndex)
          Checks to make sure a value exists for the given index.
 boolean isRowAvailable(Object rowKey)
          Check for an available row by row key.
 void setRowIndex(int rowIndex)
          Sets up a value at a particular index to be the current value.
 void setRowKey(Object rowKey)
          Sets up a value at a particular rowKey to be the current value.
 

Method Detail

getRowCount

int getRowCount()
Gets the number of values in this collection

Returns:
-1 if the number of values is not known.

getRowIndex

int getRowIndex()
Gets the index of the current value. The current value is returned by calling {link #getRowData}

Returns:
the zero-based index of the current value, or -1 if there is no current value

setRowIndex

void setRowIndex(int rowIndex)
Sets up a value at a particular index to be the current value. The current value is returned by calling {link #getRowData}

Parameters:
rowIndex - the zero-based index of the value to make current. Use -1 to clear the current value

getRowKey

Object getRowKey()
Gets the rowKey of the current value. The current value is returned by calling {link #getRowData}

Returns:
the rowKey of the current value, or null if there is no current value

setRowKey

void setRowKey(Object rowKey)
Sets up a value at a particular rowKey to be the current value. The current value is returned by calling {link #getRowData}

Parameters:
rowKey - the rowKey of the value to make current. Use null to clear the current value

isRowAvailable

boolean isRowAvailable()
Checks to make sure a value exists for the current index or rowKey. This is useful if the number of values in this collection is not known (See getRowCount()).

Returns:
true if a value exists; false otherwise.
See Also:
getRowKey(), getRowIndex()

getRowData

Object getRowData()
Gets the current value identified by the current index or rowKey.

Returns:
null if the current value has been cleared.
See Also:
getRowKey(), getRowIndex()

isRowAvailable

boolean isRowAvailable(int rowIndex)
Checks to make sure a value exists for the given index.

Parameters:
rowIndex - the index of the row to check.
Returns:
true if a value exists; false otherwise.

getRowData

Object getRowData(int rowIndex)
Gets the row value at the given index.

Parameters:
rowIndex - the index of the row to get data from.
Returns:
null if the current value has been cleared.

isRowAvailable

boolean isRowAvailable(Object rowKey)
Check for an available row by row key.

Parameters:
rowKey - the row key for the row to check.
Returns:
true if a value exists; false otherwise.

getRowData

Object getRowData(Object rowKey)
Get row data by row key.

Parameters:
rowKey - the row key for the row to get data.
Returns:
row data

areRowsAvailable

boolean areRowsAvailable(int rowsToCheck)
Check if a range of rows is available starting from the current position

Parameters:
rowsToCheck - number of rows to check
Returns:
true if all rows in range are available

areRowsAvailable

boolean areRowsAvailable(int startIndex,
                         int rowsToCheck)
Check if a range of rows is available from a starting index without requiring the client to iterate over the rows

Parameters:
startIndex - the starting index for the range
rowsToCheck - number of rows to check
Returns:
true if all rows in range are available

areRowsAvailable

boolean areRowsAvailable(Object startRowKey,
                         int rowsToCheck)
Check if a range of rows is available from a starting row key without requiring the client to iterate over the rows

Parameters:
startRowKey - the starting row key for the range
rowsToCheck - number of rows to check
Returns:
true if all rows in range are available


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.