org.apache.uima.cas.impl
Class DefaultFSAnnotationComparator

java.lang.Object
  extended by org.apache.uima.cas.impl.DefaultFSAnnotationComparator
All Implemented Interfaces:
FSComparator

public class DefaultFSAnnotationComparator
extends java.lang.Object
implements FSComparator

Default implementation to compare two annotations.

Version:
$Revision: 1.1 $

Constructor Summary
DefaultFSAnnotationComparator(CAS cas)
           
 
Method Summary
 int compare(FeatureStructure fs1, FeatureStructure fs2)
          Compare two annotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFSAnnotationComparator

public DefaultFSAnnotationComparator(CAS cas)
Method Detail

compare

public int compare(FeatureStructure fs1,
                   FeatureStructure fs2)
Compare two annotations. First compare by start position, where smaller start position means smaller annotation. If start positions are equal, compare by end position, where larger end position is smaller. Finally, compare by type code, arbitrarily. Does not compare feature values.

Specified by:
compare in interface FSComparator
Parameters:
fs1 - FS1.
fs2 - FS2.
Returns:
-1, if FS1 is "smaller" than FS2; 1, if FS2 is smaller than FS1; and 0, if FS1 equals FS2.


Copyright © 2013. All Rights Reserved.