- java.lang.Object
-
- jakarta.faces.model.DataModel<E>
-
- org.omnifaces.model.IterableDataModel<E>
-
- All Implemented Interfaces:
Iterable<E>
public class IterableDataModel<E> extends DataModel<E>
IterableDataModel is an implementation ofDataModel
that wraps anIterable
.This can be used to encapsulate nearly every collection type, including
Collection
derived types such asList
andSet
. As such this specific DataModel can be used instead of more specific DataModels likeListDataModel
andCollectionDataModel
.- Since:
- 1.5
- Author:
- Arjan.Tijms
-
-
Constructor Summary
Constructors Constructor Description IterableDataModel(Iterable<E> iterable)
Construct the iterable data model based on the given iterable instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getRowCount()
E
getRowData()
int
getRowIndex()
Object
getWrappedData()
boolean
isRowAvailable()
void
setRowIndex(int rowIndex)
void
setWrappedData(Object data)
-
Methods inherited from class jakarta.faces.model.DataModel
addDataModelListener, getDataModelListeners, iterator, removeDataModelListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
isRowAvailable
public boolean isRowAvailable()
- Specified by:
isRowAvailable
in classDataModel<E>
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in classDataModel<E>
-
getRowData
public E getRowData()
- Specified by:
getRowData
in classDataModel<E>
-
getRowIndex
public int getRowIndex()
- Specified by:
getRowIndex
in classDataModel<E>
-
setRowIndex
public void setRowIndex(int rowIndex)
- Specified by:
setRowIndex
in classDataModel<E>
-
getWrappedData
public Object getWrappedData()
- Specified by:
getWrappedData
in classDataModel<E>
-
setWrappedData
public void setWrappedData(Object data)
- Specified by:
setWrappedData
in classDataModel<E>
-
-