|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.usecases.rolodex.GenericComparator
public class GenericComparator
Generic comparator that uses a list of property names to compare
the state of two objects using the reflection API. The property names
are passed via a comma delimited. The collating sequence is determined
by the sortAcending
attribute.
Field Summary | |
---|---|
static Log |
log
Common logger utility. |
protected List |
sortBy
Holds an array of property names in the target object that will be use to compare the two objects. |
Constructor Summary | |
---|---|
GenericComparator()
|
Method Summary | |
---|---|
int |
compare(Object o1,
Object o2)
Compares the property names in the sortBy list with
the target sortable objects. |
boolean |
getSortAscending()
Returns true if the collection should be sorted ascending by
the sortBy properties list. |
String |
getSortBy()
Returns a comma delimited list of property names used to compare two objects. |
void |
setSortAscending(boolean value)
Sets the sequence the collection should be sorted. |
void |
setSortBy(String properties)
Passed a comma delimited list of property names to compare two object by. |
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 |
---|
public static Log log
Common logger utility.
protected List sortBy
Holds an array of property names in the target object that will be use to compare the two objects.
Constructor Detail |
---|
public GenericComparator()
Method Detail |
---|
public boolean getSortAscending()
Returns true
if the collection should be sorted ascending by
the sortBy
properties list.
public void setSortAscending(boolean value)
Sets the sequence the collection should be sorted. A true
will result in sort ascending.
public void setSortBy(String properties)
Passed a comma delimited list of property names to compare two object by.
public String getSortBy()
Returns a comma delimited list of property names used to compare two objects.
public int compare(Object o1, Object o2)
Compares the property names in the sortBy
list with
the target sortable objects. The collating sequence is determined
by the sortAcending
attribute.
compare
in interface Comparator
o1
- -
target object 1o2
- -
target object 2
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |