/** * Internally removes an annotation from the {@link CAS}. * * @param featureStructure the feature structure */ private void removeAnnotationInternal(FeatureStructure featureStructure) { getCAS().getIndexRepository().removeFS(featureStructure); }
private <T extends AnnotationFS> T createDocumentAnnotation(int length) { final TypeSystemImpl ts = this.svd.casMetadata.ts; // Remove any existing document annotations. FSIterator<T> it = this.<T>getAnnotationIndex(ts.docType).iterator(); List<T> list = new ArrayList<T>(); while (it.isValid()) { list.add(it.get()); it.moveToNext(); } for (int i = 0; i < list.size(); i++) { getIndexRepository().removeFS(list.get(i)); } return this.<T>ll_getFSForRef(ll_createDocumentAnnotation(length)); }