public class IlvColumnValueComparator extends Object implements Comparator, Serializable
IlvColumnValueComparatorFactory
,
Serialized FormConstructor and Description |
---|
IlvColumnValueComparator(IlvObjectModelWithColumns model,
IlvDataColumnInfo column)
Creates a comparator that uses a given column to compare objects of a
given model.
|
IlvColumnValueComparator(IlvObjectModelWithColumns model,
IlvDataColumnInfo column,
Comparator comparator,
boolean inverted)
Creates a comparator that uses a given column to compare objects of a
given model.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2)
Compares two model objects.
|
IlvObjectModelWithColumns |
getModel()
Returns the model whose objects are compared.
|
IlvDataColumnInfo |
getSortColumn()
Returns the columns whose values are used for comparison.
|
Comparator |
getValuesComparator()
Returns the comparator used to compare values of the column.
|
boolean |
isInverted()
Returns
true if the comparison is inverted. |
void |
setInverted(boolean inverted)
Determines whether the comparison is inverted or not.
|
void |
setValuesComparator(Comparator comparator)
Sets the comparator that is used to compare values of the column.
|
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 IlvColumnValueComparator(IlvObjectModelWithColumns model, IlvDataColumnInfo column, Comparator comparator, boolean inverted)
model
- The model whose objects will be compared.column
- The column of the model whose values are used for comparison.comparator
- A Comparator for comparing the column values, or
null
denoting a default comparator.inverted
- true
if the comparison is inverted.public IlvColumnValueComparator(IlvObjectModelWithColumns model, IlvDataColumnInfo column)
model
- The model whose objects will be compared.column
- The column of the model whose values are used for comparison.public int compare(Object o1, Object o2)
compare
in interface Comparator
public IlvObjectModelWithColumns getModel()
public IlvDataColumnInfo getSortColumn()
public Comparator getValuesComparator()
null
when a default comparator is
used that assumes that all values are Comparable
.public void setValuesComparator(Comparator comparator)
comparator
- A Comparator, or null
denoting a default
comparator.public boolean isInverted()
true
if the comparison is inverted.public void setInverted(boolean inverted)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.