gate
Interface SimpleAnnotationSet

All Superinterfaces:
Cloneable, Collection, Serializable, Set
All Known Subinterfaces:
AnnotationSet, EventAwareAnnotationSet
All Known Implementing Classes:
AnnotationSetImpl, DatabaseAnnotationSetImpl

public interface SimpleAnnotationSet
extends Set, Cloneable, Serializable

Annotation sets


Method Summary
 Integer add(Long start, Long end, String type, FeatureMap features)
          Create and add an annotation and return its id
 Integer add(Node start, Node end, String type, FeatureMap features)
          Create and add an annotation with pre-existing nodes, and return its id
 boolean add(Object o)
          Add an existing annotation.
 AnnotationSet get()
          Get all annotations
 Annotation get(Integer id)
          Find annotations by id
 AnnotationSet get(Set types)
          Select annotations by a set of types.
 AnnotationSet get(String type)
          Select annotations by type
 Set getAllTypes()
          Get a set of java.lang.String objects representing all the annotation types present in this annotation set.
 Document getDocument()
          Get the document this set is attached to.
 String getName()
          Get the name of this set.
 Iterator iterator()
          Get an iterator for this set
 boolean remove(Object o)
          Remove an element from this set.
 int size()
          The size of this set
 
Methods inherited from interface java.util.Set
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Method Detail

add

public Integer add(Node start,
                   Node end,
                   String type,
                   FeatureMap features)
Create and add an annotation with pre-existing nodes, and return its id


add

public Integer add(Long start,
                   Long end,
                   String type,
                   FeatureMap features)
            throws InvalidOffsetException
Create and add an annotation and return its id

Throws:
InvalidOffsetException

add

public boolean add(Object o)
Add an existing annotation. Returns true when the set is modified.

Specified by:
add in interface Set

iterator

public Iterator iterator()
Get an iterator for this set

Specified by:
iterator in interface Set

size

public int size()
The size of this set

Specified by:
size in interface Set

remove

public boolean remove(Object o)
Remove an element from this set.

Specified by:
remove in interface Set

get

public Annotation get(Integer id)
Find annotations by id


get

public AnnotationSet get()
Get all annotations


get

public AnnotationSet get(String type)
Select annotations by type


get

public AnnotationSet get(Set types)
Select annotations by a set of types. Expects a Set of String.


getName

public String getName()
Get the name of this set.


getAllTypes

public Set getAllTypes()
Get a set of java.lang.String objects representing all the annotation types present in this annotation set.


getDocument

public Document getDocument()
Get the document this set is attached to.