use of gate.event.DocumentEvent in project gate-core by GateNLP.
the class DocumentImpl method getAnnotations.
// getAnnotations()
/**
* Get a named set of annotations. Creates a new set if one with this name
* doesn't exist yet. If the provided name is null or the empty string then
* it returns the default annotation set.
*/
@Override
public AnnotationSet getAnnotations(String name) {
if (name == null || "".equals(name))
return getAnnotations();
if (namedAnnotSets == null) {
namedAnnotSets = new HashMap<String, AnnotationSet>();
}
AnnotationSet namedSet = namedAnnotSets.get(name);
if (namedSet == null) {
namedSet = new AnnotationSetImpl(this, name);
namedAnnotSets.put(name, namedSet);
DocumentEvent evt = new DocumentEvent(this, DocumentEvent.ANNOTATION_SET_ADDED, name);
fireAnnotationSetAdded(evt);
}
return namedSet;
}
use of gate.event.DocumentEvent in project gate-core by GateNLP.
the class DocumentImpl method getAnnotations.
/**
* Get the default set of annotations. The set is created if it doesn't exist
* yet.
*/
@Override
public AnnotationSet getAnnotations() {
if (defaultAnnots == null) {
defaultAnnots = new AnnotationSetImpl(this, "");
fireAnnotationSetAdded(new DocumentEvent(this, DocumentEvent.ANNOTATION_SET_ADDED, ""));
}
// if
return defaultAnnots;
}
Aggregations