public class ArrayDataModel<E> extends DataModel<E>
Constructor and Description |
---|
ArrayDataModel() |
ArrayDataModel(E[] array) |
Modifier and Type | Method and Description |
---|---|
int |
getRowCount()
Return the number of rows of data available.
|
E |
getRowData()
Return the object associated with the current row index.
|
int |
getRowIndex()
Get the current row index.
|
Object |
getWrappedData()
Get the entire collection of data associated with this component.
|
boolean |
isRowAvailable()
Returns true if a call to getRowData will return a valid object.
|
void |
setRowIndex(int rowIndex)
Set the current row index.
|
void |
setWrappedData(Object data)
Set the entire list of data associated with this component.
|
addDataModelListener, getDataModelListeners, iterator, removeDataModelListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ArrayDataModel()
public ArrayDataModel(E[] array)
public int getRowCount()
DataModel
Return the number of rows of data available.
If the number of rows of data available is not known then -1 is returned. This may happen for DataModels that wrap sources of data such as java.sql.ResultSet that provide an iterator to access the "next item" rather than a fixed-size collection of data.
getRowCount
in class DataModel<E>
public E getRowData()
DataModel
Method isRowAvailable may be called before attempting to access this method, to ensure that the data is available.
getRowData
in class DataModel<E>
public int getRowIndex()
DataModel
getRowIndex
in class DataModel<E>
public Object getWrappedData()
DataModel
getWrappedData
in class DataModel<E>
public boolean isRowAvailable()
DataModel
isRowAvailable
in class DataModel<E>
public void setRowIndex(int rowIndex)
DataModel
setRowIndex
in class DataModel<E>
rowIndex
- The row index. It may be -1 to indicate "no row",
or may be a value between 0 and getRowCount()-1.public void setWrappedData(Object data)
DataModel
setWrappedData
in class DataModel<E>
data
- The object to be wrapped.Copyright © 2019 The Apache Software Foundation. All rights reserved.