Package org.apache.uima.cas.impl
Class DefaultAnnotationComparator
- java.lang.Object
-
- org.apache.uima.cas.impl.DefaultAnnotationComparator
-
- All Implemented Interfaces:
FSImplComparator
public class DefaultAnnotationComparator extends java.lang.Object implements FSImplComparator
Default implementation to compare two annotations.- Version:
- $Revision: 1.2 $
-
-
Constructor Summary
Constructors Constructor Description DefaultAnnotationComparator(CASImpl cas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(int addr1, int addr2)
Compare two annotations.
-
-
-
Constructor Detail
-
DefaultAnnotationComparator
public DefaultAnnotationComparator(CASImpl cas)
-
-
Method Detail
-
compare
public int compare(int addr1, int addr2)
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 interfaceFSImplComparator
- Parameters:
addr1
- Address of FS1.addr2
- Address of FS2.- Returns:
-1
, if FS1 is "smaller" than FS2;1
, if FS2 is smaller than FS1; and0
, if FS1 equals FS2.
-
-