public interface FSIndexRepository
Modifier and Type | Method and Description |
---|---|
<T extends FeatureStructure> |
addFS(T fs)
Add a feature structure to all appropriate indexes in the repository.
|
default <T extends FeatureStructure> |
getAllIndexedFS(Class<T> clazz)
Gets an FSIterator over all indexed (in this view) FeatureStructures of the specified Type (and any of its
subtypes).
|
<T extends FeatureStructure> |
getAllIndexedFS(Type aType)
Gets an iterator over all indexed (in this View) FeatureStructures of the specified Type (and any of its
subtypes).
|
<T extends FeatureStructure> |
getIndex(String label)
Retrieve an index according to a label.
|
<T extends FeatureStructure> |
getIndex(String label,
Type type)
Retrieve an index according to a label and a type.
|
<T extends TOP> |
getIndexedFSs()
Returns an unmodifiable collection of all of the FSs
that are indexed in this view, in an arbitrary order.
|
<T extends TOP> |
getIndexedFSs(Class<T> clazz)
Returns an unmodifiable collection of all the FSs of this type and its subtypes,
that are indexed in this view, in an arbitrary order.
|
<T extends TOP> |
getIndexedFSs(Type type)
Returns an unmodifiable collection of all the FSs of this type and its subtypes,
that are indexed in this view, in an arbitrary order.
|
<T extends FeatureStructure> |
getIndexes()
Get all indexes in this repository.
|
Iterator<String> |
getLabels()
Get all labels for all indexes.
|
<T extends FeatureStructure> |
ll_getIndexes()
Get all indexes in this repository as low level indexes
|
default <T extends TOP> |
removeAllExcludingSubtypes(Class<T> clazz)
Remove all instances of just this type, excluding subtypes, from all indexes in the repository view.
|
void |
removeAllExcludingSubtypes(Type type)
Remove all instances of just this type, excluding subtypes, from all indexes in the repository view.
|
default <T extends TOP> |
removeAllIncludingSubtypes(Class<T> clazz)
Remove all instances of type, including all subtypes from all indexes in the repository view.
|
void |
removeAllIncludingSubtypes(Type type)
Remove all instances of type, including all subtypes from all indexes in the repository view.
|
<T extends FeatureStructure> |
removeFS(T fs)
Remove a feature structure from all indexes in the repository.
|
<T extends FeatureStructure> FSIndex<T> getIndex(String label)
T
- the Java class associated with the top-most type of the indexlabel
- The name of the index.label
, or null
if no such index
is defined.<T extends FeatureStructure> FSIndex<T> getIndex(String label, Type type) throws CASRuntimeException
T
- The Java class associated with the typelabel
- The name of the index.type
- A subtype of the type of the index.null
if an index with that name doesn't exist.CASRuntimeException
- When type
is not a subtype of the index's type.<T extends FeatureStructure> Iterator<FSIndex<T>> getIndexes()
T
- the generic type of the FeatureStructures<T extends FeatureStructure> Iterator<LowLevelIndex<T>> ll_getIndexes()
T
- the generic type of the FeatureStructures<T extends FeatureStructure> void addFS(T fs)
Important: after you have called addFS()
on a FS, do not change the
values of any features used for indexing. If you do, the index will become corrupted and may be
unusable. If you need to change an index feature value, first call
removeFS()
on the FS, change the feature values, then call
addFS()
again.
T
- the generic type of the FeatureStructurefs
- The FS to be added.NullPointerException
- If the fs
parameter is null
.<T extends FeatureStructure> void removeFS(T fs)
T
- the generic type of the FeatureStructurefs
- The FS to be removed. The fs must be the exact FS to remove, not just one
which compares "equal" using the index's comparator.NullPointerException
- If the fs
parameter is null
.void removeAllIncludingSubtypes(Type type)
type
- the type to removeNullPointerException
- if the type
parameter is null
.default <T extends TOP> void removeAllIncludingSubtypes(Class<T> clazz)
T
- the type to removeclazz
- the JCas class of the type to remove. To remove all use TOP.classNullPointerException
- if the clazz
parameter is null
.void removeAllExcludingSubtypes(Type type)
type
- the type to removeNullPointerException
- if the type
parameter is null
.default <T extends TOP> void removeAllExcludingSubtypes(Class<T> clazz)
T
- the type to removeclazz
- the JCas Class of the type to removeNullPointerException
- if the type
parameter is null
.<T extends FeatureStructure> FSIterator<T> getAllIndexedFS(Type aType)
T
- The Java class associated with aTypeaType
- The typeaType
and its subtypes, in no particular order.default <T extends FeatureStructure> FSIterator<T> getAllIndexedFS(Class<T> clazz)
T
- The Java class associated with aTypeclazz
- The JCas class corresponding to the type<T extends TOP> Collection<T> getIndexedFSs(Type type)
T
- The Java class associated with typetype
- the type of Feature Structures to include (including subtypes)<T extends TOP> Collection<T> getIndexedFSs(Class<T> clazz)
T
- The Java class associated with typeclazz
- The JCas class corresponding to the type<T extends TOP> Collection<T> getIndexedFSs()
T
- The Java class associated with typeCopyright © 2006–2021 The Apache Software Foundation. All rights reserved.