Package org.omnifaces.model
Class IterableDataModel<E>
- 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 ofDataModelthat wraps anIterable.This can be used to encapsulate nearly every collection type, including
Collectionderived types such asListandSet. As such this specific DataModel can be used instead of more specific DataModels likeListDataModelandCollectionDataModel.- 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 intgetRowCount()EgetRowData()intgetRowIndex()ObjectgetWrappedData()booleanisRowAvailable()voidsetRowIndex(int rowIndex)voidsetWrappedData(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:
isRowAvailablein classDataModel<E>
-
getRowCount
public int getRowCount()
- Specified by:
getRowCountin classDataModel<E>
-
getRowData
public E getRowData()
- Specified by:
getRowDatain classDataModel<E>
-
getRowIndex
public int getRowIndex()
- Specified by:
getRowIndexin classDataModel<E>
-
setRowIndex
public void setRowIndex(int rowIndex)
- Specified by:
setRowIndexin classDataModel<E>
-
getWrappedData
public Object getWrappedData()
- Specified by:
getWrappedDatain classDataModel<E>
-
setWrappedData
public void setWrappedData(Object data)
- Specified by:
setWrappedDatain classDataModel<E>
-
-