Package org.primefaces.model
Class LazyDataModel<T>
- java.lang.Object
-
- javax.faces.model.DataModel<E>
-
- javax.faces.model.ListDataModel<T>
-
- org.primefaces.model.LazyDataModel<T>
-
- All Implemented Interfaces:
Serializable,Iterable<T>,SelectableDataModel<T>
public abstract class LazyDataModel<T> extends javax.faces.model.ListDataModel<T> implements SelectableDataModel<T>, Serializable
Lazy loading DataModel to deal with huge datasets- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LazyDataModel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetPageSize()intgetRowCount()TgetRowData(String rowKey)StringgetRowKey(T object)List<T>getWrappedData()Iterator<T>iterator()Iterator<T>iterator(Map<String,SortMeta> sortBy, Map<String,FilterMeta> filterBy)abstract List<T>load(int first, int pageSize, Map<String,SortMeta> sortBy, Map<String,FilterMeta> filterBy)Loads the data for the given parameters.voidsetPageSize(int pageSize)voidsetRowCount(int rowCount)voidsetRowIndex(int rowIndex)-
Methods inherited from class javax.faces.model.ListDataModel
getRowData, getRowIndex, isRowAvailable, setWrappedData
-
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, 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
-
load
public abstract List<T> load(int first, int pageSize, Map<String,SortMeta> sortBy, Map<String,FilterMeta> filterBy)
Loads the data for the given parameters.- Parameters:
first- the first entrypageSize- the page sizesortBy- a list with all sort informationfilterBy- a map with all filter information- Returns:
- the data
-
getRowData
public T getRowData(String rowKey)
- Specified by:
getRowDatain interfaceSelectableDataModel<T>
-
getRowKey
public String getRowKey(T object)
- Specified by:
getRowKeyin interfaceSelectableDataModel<T>
-
iterator
public Iterator<T> iterator(Map<String,SortMeta> sortBy, Map<String,FilterMeta> filterBy)
-
getRowCount
public int getRowCount()
- Overrides:
getRowCountin classjavax.faces.model.ListDataModel<T>
-
setRowIndex
public void setRowIndex(int rowIndex)
- Overrides:
setRowIndexin classjavax.faces.model.ListDataModel<T>
-
getWrappedData
public List<T> getWrappedData()
- Overrides:
getWrappedDatain classjavax.faces.model.ListDataModel<T>
-
getPageSize
public int getPageSize()
-
setPageSize
public void setPageSize(int pageSize)
-
setRowCount
public void setRowCount(int rowCount)
-
-