|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - The ordered class.public interface Order<T>
An Order is a class that represents an ordering of a Galago Type. You won't usually implement this interface directly; instead, let Galago make the class for you with the TemplateTypeBuilder/TypeBuilderMojo tools.
| Method Summary | |
|---|---|
java.lang.Class<T> |
getOrderedClass()
|
java.lang.String[] |
getOrderSpec()
Returns a string representation of the fields ordered by this class. |
java.util.Comparator<T> |
greaterThan()
lessThan().compare(a,b) = greaterThan().compare(b,a); |
int |
hash(T object)
This is a hash function over an object that only uses ordered fields. |
java.util.Comparator<T> |
lessThan()
Returns a comparator that applies this order to objects of type T. |
ReaderSource<T> |
orderedCombiner(java.util.Collection<TypeReader<T>> readers,
boolean closeOnExit)
Produces an OrderedCombiner object. |
TypeReader<T> |
orderedReader(ArrayInput input)
Produces an OrderedReader object. |
TypeReader<T> |
orderedReader(ArrayInput input,
int bufferSize)
Produces an OrderedReader object. |
Processor<T> |
orderedWriter(ArrayOutput output)
Produces an OrderedWriter object that can write objects of class T in this order. |
| Method Detail |
|---|
java.lang.Class<T> getOrderedClass()
java.lang.String[] getOrderSpec()
{ "+document", "-score" }
means that this order orders first by the document number in ascending order, but
breaks ties by the score in descending order.
java.util.Comparator<T> lessThan()
getOrderSpec() == { "+document" } and
a.document = 5 and b.document = 7, then:
lessThan().compare(a, b) < 0.
java.util.Comparator<T> greaterThan()
int hash(T object)
{ "+document", "-score" }, this
hash function incorporates data from the document and score fields, but
no other fields.
object -
Processor<T> orderedWriter(ArrayOutput output)
output -
TypeReader<T> orderedReader(ArrayInput input)
input -
TypeReader<T> orderedReader(ArrayInput input,
int bufferSize)
input - bufferSize -
ReaderSource<T> orderedCombiner(java.util.Collection<TypeReader<T>> readers,
boolean closeOnExit)
readers - closeOnExit -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||