public class TupleComparator
extends java.lang.Object
implements java.util.Comparator
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two tuples.
|
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 descendingCopyright ? 2013 Regents of the University of California