org.apache.myfaces.component.html.ext
Class BaseSortableModel
java.lang.Object
javax.faces.model.DataModel
org.apache.myfaces.component.html.ext.BaseSortableModel
- All Implemented Interfaces:
- java.lang.Iterable
- Direct Known Subclasses:
- SortableModel
public class BaseSortableModel
- extends javax.faces.model.DataModel
BaseSortableModel provides a DataModel that is automatically sorted by the specified Comparator.
Each time the Comparator is set, the model will be resorted.
- Since:
- 1.1.7
- Version:
- $Revision: 691871 $
Field Summary |
protected javax.faces.model.DataModel |
_model
|
Constructor Summary |
BaseSortableModel()
No arg constructor for use as a managed-bean. |
BaseSortableModel(java.lang.Object model)
Create a new SortableModel from the given instance. |
Methods inherited from class javax.faces.model.DataModel |
addDataModelListener, getDataModelListeners, iterator, removeDataModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_model
protected javax.faces.model.DataModel _model
BaseSortableModel
public BaseSortableModel(java.lang.Object model)
- Create a new SortableModel from the given instance.
- Parameters:
model
- This will be converted into a DataModel
- See Also:
setWrappedData(java.lang.Object)
BaseSortableModel
public BaseSortableModel()
- No arg constructor for use as a managed-bean.
Must call setWrappedData before using this instance.
getComparator
public java.util.Comparator getComparator()
setComparator
public void setComparator(java.util.Comparator comparator)
getRowData
public java.lang.Object getRowData()
- Specified by:
getRowData
in class javax.faces.model.DataModel
getWrappedData
public java.lang.Object getWrappedData()
- Specified by:
getWrappedData
in class javax.faces.model.DataModel
isRowAvailable
public boolean isRowAvailable()
- Specified by:
isRowAvailable
in class javax.faces.model.DataModel
setWrappedData
public void setWrappedData(java.lang.Object data)
- Sets the underlying data being managed by this instance.
- Specified by:
setWrappedData
in class javax.faces.model.DataModel
- Parameters:
data
- This Object will be converted into a
DataModel
.
toDataModel
protected javax.faces.model.DataModel toDataModel(java.lang.Object data)
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in class javax.faces.model.DataModel
setRowIndex
public void setRowIndex(int rowIndex)
- Specified by:
setRowIndex
in class javax.faces.model.DataModel
getRowIndex
public int getRowIndex()
- Specified by:
getRowIndex
in class javax.faces.model.DataModel
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
sort
public void sort()
- Sorts the underlying collection by the Comparator.
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.