java.util.Comparator<T>
public class GroupOrderByComparator<T extends Group>
extends java.lang.Object
implements java.util.Comparator<T>
GroupOrderByComparator
is an OrderByComparator
that operates on groups and understands that some of the "order by"
properties are group properties (these must all be before the other "order
by" properties that aren't group properties).Constructor | Description |
---|---|
GroupOrderByComparator(OrderByComparator<java.lang.Object> orderByComparator,
java.util.List<java.lang.String> groupByProperties) |
Constructs a
GroupOrderByComparator that operates on the
given List of "order by" expressions, and assumes that the
Groups are grouped by the given List of "group
by" expressions. |
Modifier and Type | Method | Description |
---|---|---|
int |
compare(T g1,
T g2) |
Compares the given
Groups to determine order. |
java.util.List<java.lang.String> |
getGroupByProperties() |
Returns the
List of "group by" properties. |
public GroupOrderByComparator(OrderByComparator<java.lang.Object> orderByComparator, java.util.List<java.lang.String> groupByProperties)
GroupOrderByComparator
that operates on the
given List
of "order by" expressions, and assumes that the
Groups
are grouped by the given List
of "group
by" expressions.orderByComparator
- An OrderByComparator
.groupByProperties
- A List
of "group by" properties.ParseException
- If there is a problem parsing the expressions, or
if any "group by" properties are preceded in the "order by" properties
by other properties that are not "group by" properties.public int compare(T g1, T g2)
Compares the given Groups
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
.
This compare method compares the group's representative objects.
compare
in interface java.util.Comparator<T extends Group>
g1
- The left-hand-side Group
to compare.g2
- The right-hand-side Group
to compare.g1
is less than, equal to, or greater than g2
.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 java.util.List<java.lang.String> getGroupByProperties()
List
of "group by" properties.List
of "group by" properties.Copyright © 2012–2018 Jett Team. All rights reserved.