public class ImmutableAnnotationSetImpl extends AnnotationSetImpl
annFactory, annotationSetListeners, annotsById, longestAnnot, relations| Constructor and Description |
|---|
ImmutableAnnotationSetImpl(Document doc,
Collection<Annotation> annotations)
Constructs an ImmutableAnnotationSet.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Annotation a)
Add an existing annotation.
|
void |
add(Integer id,
Long start,
Long end,
String type,
FeatureMap features)
Create and add an annotation from database read data In this case the id is
already known being previously fetched from the database
|
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)
The following methods throw an exception as they try to modify the state of
the object
|
boolean |
addAll(Collection<? extends Annotation> arg0)
Adds multiple annotations to this set in one go.
|
void |
clear() |
boolean |
remove(Object o)
Remove an element from this set.
|
boolean |
removeAll(Collection<?> arg0) |
boolean |
retainAll(Collection<?> arg0) |
addAllKeepIDs, addAnnotationSetListener, addGateListener, clone, edit, emptyAS, fireAnnotationAdded, fireAnnotationRemoved, fireGateEvent, firstNode, get, get, get, get, get, get, get, get, get, get, getAllTypes, getContained, getCovering, getDocument, getName, getRelations, getStartingAt, getStrict, indexByStartOffset, indexByType, inDocumentOrder, iterator, lastNode, nextNode, removeAnnotationSetListener, removeFromIdIndex, removeFromOffsetIndex, removeFromTypeIndex, removeGateListener, setAnnotationFactory, sizeequals, hashCodecontains, containsAll, isEmpty, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, spliterator, toArray, toArrayparallelStream, removeIf, streampublic ImmutableAnnotationSetImpl(Document doc, Collection<Annotation> annotations) throws ClassCastException
annotations - ClassCastExceptionpublic Integer add(Node start, Node end, String type, FeatureMap features)
add in interface SimpleAnnotationSetadd in class AnnotationSetImplstart - the start node for the new annotationend - the end node for the new annotationtype - the annotation typefeatures - the features for the new annotationpublic Integer add(Long start, Long end, String type, FeatureMap features)
AnnotationSetImpladd in interface SimpleAnnotationSetadd in class AnnotationSetImplstart - the start offset for the new annotationend - the end offset for the new annotationtype - the annotation typefeatures - the features for the new annotationpublic boolean add(Annotation a)
AnnotationSetImpladd in interface SimpleAnnotationSetadd in interface Collection<Annotation>add in interface Set<Annotation>add in class AnnotationSetImpla - the annotation to addtrue if the set was modified by this
operation, false otherwise.public void add(Integer id, Long start, Long end, String type, FeatureMap features) throws InvalidOffsetException
AnnotationSetImpladd in interface AnnotationSetadd in class AnnotationSetImplid - the ID for the new annotationstart - the start offset for the new annotationend - the end offset for the new annotationtype - the annotation typefeatures - the features for the new annotationInvalidOffsetException - if the start or end offsets are
null, or if the start offset is less than
0 or the end offset is greater than the length of the
document.public boolean removeAll(Collection<?> arg0)
removeAll in interface Collection<Annotation>removeAll in interface Set<Annotation>removeAll in class AbstractSet<Annotation>public boolean addAll(Collection<? extends Annotation> arg0)
AnnotationSetImplAnnotation type, otherwise a
ClassCastException will be thrown. The provided annotations will be used to
create new annotations using the appropriate add() methods from this set.
The new annotations will have different IDs from the old ones (which is
required in order to preserve the uniqueness of IDs inside an annotation
set).addAll in interface Collection<Annotation>addAll in interface Set<Annotation>addAll in class AnnotationSetImplarg0 - a collection of annotationspublic boolean remove(Object o)
AnnotationSetImplremove in interface SimpleAnnotationSetremove in interface Collection<Annotation>remove in interface Set<Annotation>remove in class AnnotationSetImplo - the element to removetrue if the set was modified by this
operation, false otherwise.public boolean retainAll(Collection<?> arg0)
retainAll in interface Collection<Annotation>retainAll in interface Set<Annotation>retainAll in class AbstractCollection<Annotation>public void clear()
clear in interface Collection<Annotation>clear in interface Set<Annotation>clear in class AnnotationSetImplCopyright © 2024 GATE. All rights reserved.