|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.data.provider.SortCriteria
The abstract SortCriteria class defines a single sort criteria for a
TableDataFilter
. This includes a boolean to indicate an ascending
(true
) or descending (false
) sort critiera.
Subclasses override the getSortValue(TableDataProvider, RowKey)
method to provide a sortable value for the particular row in the table.
An array of these SortCriteria objects are used to define the sort order
for a TableDataProvider
.
Constructor Summary | |
SortCriteria()
Constructs a new SortCriteria object with no display name and the default state for include ( true ). |
|
SortCriteria(java.lang.String displayName)
Constructs a new SortCriteria object with the specified display name and the default state for the include/exclude ( true ==
include). |
|
SortCriteria(java.lang.String displayName,
boolean ascending)
Constructs a new SortCriteria object with the specified display name and state for include/exclude ( true == include). |
Method Summary | |
abstract java.lang.String |
getCriteriaKey()
Returns a String uniquely identifying this sort criteria. |
java.lang.String |
getDisplayName()
Returns the display name for this sort criteria. |
abstract java.lang.Object |
getSortValue(TableDataProvider provider,
RowKey rowKey)
Provides the data value to use while sorting a particular row. |
boolean |
isAscending()
Returns the ascending sort state for this SortCriteria |
void |
setAscending(boolean ascending)
Sets the ascending sort state for this SortCriteria |
void |
setDisplayName(java.lang.String displayName)
Sets the display name for this filter criteria. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SortCriteria()
Constructs a new SortCriteria object with no display name and the
default state for include (true
).
public SortCriteria(java.lang.String displayName)
Constructs a new SortCriteria object with the specified display name
and the default state for the include/exclude (true ==
include).
displayName
- The desired display name for this filter criteriapublic SortCriteria(java.lang.String displayName, boolean ascending)
Constructs a new SortCriteria object with the specified display name
and state for include/exclude (true
== include).
displayName
- The desired display name for this filter criteriaascending
- true
for ascending sort, or
false
for descending.Method Detail |
public void setDisplayName(java.lang.String displayName)
Sets the display name for this filter criteria.
displayName
- The desired display name for this filter criteriapublic java.lang.String getDisplayName()
Returns the display name for this sort criteria.
public void setAscending(boolean ascending)
ascending
- true
for ascending, false
for desscendingpublic boolean isAscending()
true
for ascending, false
for
descendingpublic abstract java.lang.String getCriteriaKey()
public abstract java.lang.Object getSortValue(TableDataProvider provider, RowKey rowKey) throws DataProviderException
Provides the data value to use while sorting a particular row. Implementations may perform whatever logic is desired to provide the data object to represent this row in a sort.
provider
- TableDataProvider
containing the data on displayrowKey
- The RowKey
of the row to be sorted
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null. A DPE may also indicate that the
passed TableDataProvider or RowKey is not valid. Consult the
documentation of the specific SortCriteria implementation for
details on what exceptions might be wrapped by a DPE.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |