|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.fikin.pojostate.state.StateSorter
public class StateSorter
Implements sorting algorithms for Property
objects
It supports sorting based on name, description and value. It supports ascending or descending ordering. created on Mar 6, 2007
Field Summary | |
---|---|
protected int |
leadField
leading State field |
protected int |
order
field's order |
Constructor Summary | |
---|---|
StateSorter(int leadField,
int order)
Initialize the comparator with given leading field and order |
Method Summary | |
---|---|
int |
compare(java.lang.Object arg0,
java.lang.Object arg1)
actual comparator logic based on what this object has been initialized with If leading field is getValue() and in case of getting
DecorationException upon executing it, it will perform comparison
based on getName() ASC. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Field Detail |
---|
protected int leadField
protected int order
Constructor Detail |
---|
public StateSorter(int leadField, int order)
leadField
- is the leading propertyorder
- is ascending or descendingMethod Detail |
---|
public int compare(java.lang.Object arg0, java.lang.Object arg1)
If leading field is getValue()
and in case of getting
DecorationException upon executing it, it will perform comparison
based on getName()
ASC.
If leading field is getValue()
or getDescription()
and comparison finds them equal, it is returned the result of
getName()
with appropriate ordering.
This is pretty much as an acting second field for ordering.
compare
in interface java.util.Comparator
arg0
- arg1
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |