|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.util.TupleComparator
public class TupleComparator
Comparator that compares Tuples based on the value of a single field.
Constructor Summary | |
---|---|
TupleComparator(int col,
java.lang.Class type,
boolean ascend)
Creates a new TupleComparator. |
|
TupleComparator(int col,
java.lang.Class type,
boolean ascend,
java.util.Comparator c)
Creates a new TupleComparator. |
|
TupleComparator(java.lang.String field,
java.lang.Class type,
boolean ascend)
Creates a new TupleComparator. |
|
TupleComparator(java.lang.String field,
java.lang.Class type,
boolean ascend,
java.util.Comparator c)
Creates a new TupleComparator. |
Method Summary | |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two tuples. |
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 |
Constructor Detail |
---|
public TupleComparator(java.lang.String field, java.lang.Class type, boolean ascend)
field
- the data field to comparetype
- the expected type of the data fieldascend
- true to sort in ascending order, false for descendingpublic TupleComparator(java.lang.String field, java.lang.Class type, boolean ascend, java.util.Comparator c)
field
- the data field to comparetype
- the expected type of the data fieldascend
- true to sort in ascending order, false for descendingc
- the comparator to use. Note that for primitive types,
this should be an instance of LiteralComparator, otherwise
subequent errors will occur.public TupleComparator(int col, java.lang.Class type, boolean ascend)
col
- the column number of the data field to comparetype
- the expected type of the data fieldascend
- true to sort in ascending order, false for descendingpublic TupleComparator(int col, java.lang.Class type, boolean ascend, java.util.Comparator c)
col
- the column number of the data field to comparetype
- the expected type of the data fieldascend
- true to sort in ascending order, false for descendingMethod Detail |
---|
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
Comparator.compare(java.lang.Object, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |