@Override void annotateAll(Collection<Annotation> annotations) { for (Annotation a : annotations) { annotate(a); } }
public void createIndex(IndexKey key) { if (key == IndexKey.SPAN_NODE && annotations instanceof ListAnnotationContainer) { AnnotationContainer tmpAnnotations = new SpanNode2AnnotationContainer(); tmpAnnotations.annotateAll(annotations.annotations()); annotations = tmpAnnotations; } else if (key == IndexKey.ANNOTATION_TYPE && annotations instanceof ListAnnotationContainer) { AnnotationContainer tmpAnnotations = new AnnotationType2AnnotationContainer(); tmpAnnotations.annotateAll(annotations.annotations()); annotations = tmpAnnotations; } else { throw new IllegalArgumentException("Multiple indexes not yet supported. Use clearIndex() or clearIndexes() first."); } }