org.eml.MMAX2.annotation.markables
Class QueryResultTupleComparator

java.lang.Object
  extended by org.eml.MMAX2.annotation.markables.QueryResultTupleComparator
All Implemented Interfaces:
java.util.Comparator

public class QueryResultTupleComparator
extends java.lang.Object
implements java.util.Comparator


Constructor Summary
QueryResultTupleComparator(int _relevantPosition)
          Creates new QueryResultTupleComparator.
 
Method Summary
 int compare(java.lang.Object _tupel1, java.lang.Object _tupel2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

QueryResultTupleComparator

public QueryResultTupleComparator(int _relevantPosition)
Creates new QueryResultTupleComparator. This orders MMAX2QueryResultTuples according to the disc pos of the Markables it contains. It compares the disc pos at position relevantPosition, and orders tuples with Markables with smaller initial disc pos before ones with Markables with greater ones. If two tuples have at the relevant position Markables with the same initial disc pos, the tuple with the shorter Markable is ordered before the one with the longer one. If both Markables have the same length, it tries to sort recursively on relevantPosition+1, if possible.

Method Detail

compare

public int compare(java.lang.Object _tupel1,
                   java.lang.Object _tupel2)
Specified by:
compare in interface java.util.Comparator