public class IlvClusterIdComparator<CIT extends IlvClusterId> extends Object implements Comparator, Serializable
IlvClusterNode
s introduced by partitioning.
The type parameter CIT
denotes the type to which all
IlvClusterId
s that are to be compared by this class belong.
Constructor and Description |
---|
IlvClusterIdComparator(IlvObjectModelWithColumns partitionedModel)
Creates a comparator that sorts cluster nodes that were introduced in a
given model.
|
IlvClusterIdComparator(IlvObjectModelWithColumns partitionedModel,
Comparator<? super CIT> idComparator,
int nonClusterPosition)
Creates a comparator that sorts cluster nodes that were introduced in a
given model.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2)
Compares two model objects.
|
Comparator<? super CIT> |
getIdComparator()
Returns the comparator used to compare cluster ids.
|
void |
setIdComparator(Comparator<? super CIT> comparator)
Sets the comparator that is used to compare cluster ids.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public IlvClusterIdComparator(IlvObjectModelWithColumns partitionedModel, Comparator<? super CIT> idComparator, int nonClusterPosition)
partitionedModel
- The model which introduced the cluster nodes through
partitioning.idComparator
- The comparator that is used to compare cluster ids, or
null
denoting a default comparator.
See IlvDefaultClusterIdComparator
.nonClusterPosition
- Determines how non-clusters are sorted: -1 means
they precede all clusters, 1 means they come at the
end, 0 means no preference.public IlvClusterIdComparator(IlvObjectModelWithColumns partitionedModel)
partitionedModel
- The model which introduced the cluster nodes through
partitioning.public int compare(Object o1, Object o2)
compare
in interface Comparator
public Comparator<? super CIT> getIdComparator()
null
when a default comparator is
used that assumes that all values are Comparable
.public void setIdComparator(Comparator<? super CIT> comparator)
comparator
- A Comparator, or null
denoting a default
comparator.IlvDefaultClusterIdComparator
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.