public class AnnotationImpl extends AbstractFeatureBearer implements Annotation
Modifier and Type | Field and Description |
---|---|
protected Node |
end
The end node
|
protected gate.annotation.AnnotationImpl.EventsHandler |
eventHandler
The listener for the events coming from the features.
|
protected Node |
start
The start node
|
features
Modifier | Constructor and Description |
---|---|
protected |
AnnotationImpl(Integer id,
Node start,
Node end,
String type,
FeatureMap features)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotationListener(AnnotationListener l)
Adds an annotation listener
|
boolean |
coextensive(Annotation anAnnot)
Two Annotation are coextensive if their offsets are the
same.
|
int |
compareTo(Object o)
Ordering
|
boolean |
equals(Object obj)
Returns true if two annotation are Equals.
|
protected void |
fireAnnotationUpdated(AnnotationEvent e) |
Node |
getEndNode()
The end node.
|
Integer |
getId()
The ID of the annotation.
|
Node |
getStartNode()
The start node.
|
String |
getType()
The type of the annotation (corresponds to TIPSTER "name").
|
int |
hashCode()
When equals called on two annotations returns true, is REQUIRED that the
value hashCode for each annotation to be the same.
|
boolean |
isCompatible(Annotation anAnnot)
This verifies if this annotation is compatible with another one.
|
boolean |
isCompatible(Annotation anAnnot,
Set<? extends Object> aFeatureNamesSet)
This verifies if this annotation is compatible with another one,
given a set with certain keys.
|
boolean |
isPartiallyCompatible(Annotation anAnnot)
This method verifies if two annotation and are partially compatible.
|
boolean |
isPartiallyCompatible(Annotation anAnnot,
Set<? extends Object> aFeatureNamesSet)
This method verifies if two annotation and are partially compatible,
given a set with certain keys.
|
boolean |
overlaps(Annotation aAnnot)
This method determines if this overlaps aAnnot, i.e.
|
void |
removeAnnotationListener(AnnotationListener l)
Removes an annotation listener
|
void |
setFeatures(FeatureMap features)
Set the feature set.
|
String |
toString()
String representation of hte annotation
|
boolean |
withinSpanOf(Annotation aAnnot)
This method tells if this annotation's text range is
fully contained within the text annotated by
aAnnot 's
annotation. |
getFeatures
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFeatures
protected gate.annotation.AnnotationImpl.EventsHandler eventHandler
protected Node start
protected Node end
protected AnnotationImpl(Integer id, Node start, Node end, String type, FeatureMap features)
id
- The id of the new annotation;start
- The node from where the annotation will depart;end
- The node where trhe annotation ends;type
- The type of the new annotation;features
- The features of the annotation.public String getType()
getType
in interface SimpleAnnotation
public Node getStartNode()
getStartNode
in interface SimpleAnnotation
public Node getEndNode()
getEndNode
in interface SimpleAnnotation
public String toString()
public int compareTo(Object o) throws ClassCastException
compareTo
in interface SimpleAnnotation
compareTo
in interface Comparable<Object>
ClassCastException
public int hashCode()
public boolean equals(Object obj)
public void setFeatures(FeatureMap features)
setFeatures
in interface FeatureBearer
setFeatures
in class AbstractFeatureBearer
public boolean isCompatible(Annotation anAnnot)
isCompatible
in interface Annotation
anAnnot
- a gate Annotation. If anAnnotation is null then false is
returned.true
if aAnnot is compatible with this and
false
otherwise.public boolean isCompatible(Annotation anAnnot, Set<? extends Object> aFeatureNamesSet)
isCompatible
in interface Annotation
anAnnot
- a gate Annotation. If param is null, it will return false.aFeatureNamesSet
- is a set containing certian key that will be
intersected with this's FeatureMap's keys.If param is null then
isCompatible(Annotation) will be called.true
if aAnnot is compatible with this and
false
otherwise.public boolean isPartiallyCompatible(Annotation anAnnot)
isPartiallyCompatible
in interface Annotation
anAnnot
- a gate Annotation.true
if this is partially compatible with
anAnnot and false
otherwise.public boolean isPartiallyCompatible(Annotation anAnnot, Set<? extends Object> aFeatureNamesSet)
isPartiallyCompatible
in interface Annotation
anAnnot
- a gate Annotation. If param is null, the method will return
false.aFeatureNamesSet
- is a set containing certian key that will be
intersected with this's FeatureMap's keys.If param is null then
isPartiallyCompatible(Annotation) will be called.true
if this is partially compatible with
aAnnot and false
otherwise.public boolean coextensive(Annotation anAnnot)
coextensive
in interface Annotation
anAnnot
- A Gate annotation.true
if two annotation hit the same possition and
false
otherwisepublic boolean overlaps(Annotation aAnnot)
Annotation
overlaps
in interface Annotation
aAnnot
- a gate Annotation.true
if they overlap and false
false if
they don't or if aAnnot is null.public boolean withinSpanOf(Annotation aAnnot)
aAnnot
's
annotation.withinSpanOf
in interface Annotation
aAnnot
- a gate Annotation.true
if this annotation is fully contained in the
other one.public void removeAnnotationListener(AnnotationListener l)
removeAnnotationListener
in interface Annotation
public void addAnnotationListener(AnnotationListener l)
addAnnotationListener
in interface Annotation
protected void fireAnnotationUpdated(AnnotationEvent e)
e
- Copyright © 2024 GATE. All rights reserved.