|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.io.SortCriterion
public class SortCriterion
A SortCriterion describes one facet of a possible way of sorting some data.
It will generally be used as a List<SortCriterion>. So the data is
sorted by the fist SortCriterion in the list first, turning to the second
only if there is an equals scenario between 2 bits of data.
It is assumed that values for each attribute can be extracted from the data.
This is generally fairly simple for Maps and Pojos.
SortCriterion does not specify a Comparator. It is assumed
that the values stored by the data against each attribute are either
Comparable or that the system can find a Comparator
Pomposity alert: I wouldn't normally be pedantic about Criteria/Criterion, but it's important to note that this is just one facet of an instruction to a sorting algorithm, and not the entire instruction.
| Constructor Summary | |
|---|---|
SortCriterion(java.lang.String attribute,
boolean descending)
All SortCriterion need an attribute and sort order. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getAttribute()
The attribute points to a data member within the data to be sorted. |
int |
hashCode()
|
boolean |
isAscending()
Are we sorting in ascending order? This is the logical negative of isDescending() |
boolean |
isDescending()
Are we sorting in descending order? |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SortCriterion(java.lang.String attribute,
boolean descending)
| Method Detail |
|---|
public java.lang.String getAttribute()
Map this will be a key. If the data
is a Pojo, it will be a property.
public boolean isDescending()
public boolean isAscending()
isDescending()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||