|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jagg.AggregateValuePropertiesComparator<T>
public class AggregateValuePropertiesComparator<T>
This class represents a Comparator that is capable of comparing
two objects based on a dynamic list of properties of the objects
of type T. These objects are wrapped in
AggregateValues. This class is used internally by
Aggregation objects to sort a
List<AggregateValue<T>> according to a specified
list of properties.
| Constructor Summary | |
|---|---|
AggregateValuePropertiesComparator(java.util.List<java.lang.String> properties)
Construct an AggregateValuePropertiesComparator that pays
attention to the given List of properties in an
AggregateValue<T>. |
|
| Method Summary | |
|---|---|
int |
compare(AggregateValue<T> av1,
AggregateValue<T> av2)
Compares the given objects to determine order. |
boolean |
equals(java.lang.Object obj)
Indicates whether the given AggregateValuePropertiesComparator is equal to this
AggregateValuePropertiesComparator. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AggregateValuePropertiesComparator(java.util.List<java.lang.String> properties)
AggregateValuePropertiesComparator that pays
attention to the given List of properties in an
AggregateValue<T>. All properties must be
Comparable.
properties - A List<String> of properties.| Method Detail |
|---|
public int compare(AggregateValue<T> av1,
AggregateValue<T> av2)
throws java.lang.UnsupportedOperationException
Compares the given objects to determine order. Fulfills the
Comparator contract by returning a negative integer, 0, or a
positive integer if o1 is less than, equal to, or greater
than o2.
Null property values compare equal to each other, and a null property compares greater than a non-null property
.
compare in interface java.util.Comparator<AggregateValue<T>>av1 - The left-hand-side object to compare.av2 - The right-hand-side object to compare.
o1
is less than, equal to, or greater than o2.
java.lang.UnsupportedOperationException - If any property specified in the
constructor doesn't correspond to a no-argument "get<Property>"
getter method in T, or if the property's type is not
Comparable.public boolean equals(java.lang.Object obj)
AggregateValuePropertiesComparator is equal to this
AggregateValuePropertiesComparator. All property names must
match in order.
equals in interface java.util.Comparator<AggregateValue<T>>equals in class java.lang.Objectobj - The other AggregateValuePropertiesComparator.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||