Class Annotation
- java.lang.Object
-
- com.lucidworks.apollo.common.pipeline.Annotation
-
- All Implemented Interfaces:
java.lang.Comparable<Annotation>
public class Annotation extends java.lang.Object implements java.lang.Comparable<Annotation>
Implementation of an Annotation. Has a type, metadata and start and end offsets referring to the position in the text of aPipelineField
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Annotation.AnnotationBuilder
Builder to buildAnnotation
.
-
Constructor Summary
Constructors Constructor Description Annotation()
Annotation(Annotation another)
Annotation(java.lang.String type, long start, long end)
Annotation(java.lang.String type, long start, long end, java.util.Map<java.lang.String,java.lang.String> features)
Annotation(java.lang.String type, long start, long end, java.util.Map<java.lang.String,java.lang.String> features, java.lang.String label)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Annotation
addFeature(java.lang.String name, java.lang.String val)
Deprecated.void
addFeatures(java.util.Map<java.lang.String,java.lang.String> features)
Deprecated.int
compareTo(Annotation target)
boolean
equals(java.lang.Object o)
Range<java.lang.Integer>
getCharRange()
long
getEnd()
int
getFeatureCount()
Deprecated.java.util.Map<java.lang.String,java.lang.String>
getFeatures()
Deprecated.java.lang.String
getLabel()
long
getStart()
java.lang.String
getType()
int
hashCode()
static Annotation.AnnotationBuilder
newAnnotation()
Annotation
setEnd(long end)
Annotation
setStart(long start)
Annotation
setType(java.lang.String type)
java.lang.String
toString()
Returns a String representation of the Annotation
-
-
-
Constructor Detail
-
Annotation
public Annotation()
-
Annotation
public Annotation(Annotation another)
-
Annotation
public Annotation(java.lang.String type, long start, long end, java.util.Map<java.lang.String,java.lang.String> features, java.lang.String label)
-
Annotation
public Annotation(java.lang.String type, long start, long end)
-
Annotation
public Annotation(java.lang.String type, long start, long end, java.util.Map<java.lang.String,java.lang.String> features)
-
-
Method Detail
-
getFeatureCount
@Deprecated public int getFeatureCount()
Deprecated.
-
getType
public java.lang.String getType()
-
setType
public Annotation setType(java.lang.String type)
-
getStart
public long getStart()
-
setStart
public Annotation setStart(long start)
-
getEnd
public long getEnd()
-
setEnd
public Annotation setEnd(long end)
-
getFeatures
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getFeatures()
Deprecated.
-
addFeatures
@Deprecated public void addFeatures(java.util.Map<java.lang.String,java.lang.String> features)
Deprecated.
-
addFeature
@Deprecated public Annotation addFeature(java.lang.String name, java.lang.String val)
Deprecated.
-
getLabel
public java.lang.String getLabel()
-
getCharRange
public Range<java.lang.Integer> getCharRange()
-
compareTo
public int compareTo(Annotation target)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Annotation>
-
toString
public java.lang.String toString()
Returns a String representation of the Annotation- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
newAnnotation
public static Annotation.AnnotationBuilder newAnnotation()
-
-