|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.uima.cas.impl.FSIndexRepositoryImpl
public class FSIndexRepositoryImpl
| Field Summary | |
|---|---|
static int |
DEFAULT_INDEX_SIZE
The default size of an index. |
| Method Summary | |
|---|---|
void |
addFS(FeatureStructure fs)
Add a feature structure to all appropriate indexes in the repository. |
void |
addFS(int fsRef)
|
void |
commit()
Commit this repository instance. |
FSIndexComparator |
createComparator()
Create a new comparator to define a new index. |
boolean |
createIndex(FSIndexComparator comp,
java.lang.String label)
Create a new sorted index. |
boolean |
createIndex(FSIndexComparator comp,
java.lang.String label,
int indexType)
Create a new index. |
boolean |
createIndexNoQuestionsAsked(FSIndexComparator comp,
java.lang.String label,
int indexType)
This is public only until the xml specifier format supports specifying index kinds (set, bag etc.). |
LinearTypeOrderBuilder |
createTypeSortOrder()
Currently not useful. |
void |
flush()
Reset all indexes. |
int[] |
getAddedFSs()
|
FSIterator<FeatureStructure> |
getAllIndexedFS(Type type)
Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its subtypes). |
LinearTypeOrderBuilder |
getDefaultOrderBuilder()
Get the default type order builder. |
LinearTypeOrder |
getDefaultTypeOrder()
Get the default type order. |
int[] |
getDeletedFSs()
|
FSIndex<FeatureStructure> |
getIndex(java.lang.String label)
Retrieve an index according to a label. |
FSIndex<FeatureStructure> |
getIndex(java.lang.String label,
Type type)
Retrieve an index according to a label and a type. |
int[] |
getIndexedFSs()
Return an array containing all FSs in any index. |
java.util.Iterator<FSIndex<FeatureStructure>> |
getIndexes()
Get all indexes in this repository. |
int |
getIndexSize(Type type)
|
IntPointerIterator |
getIntIteratorForIndex(java.lang.String label)
|
IntPointerIterator |
getIntIteratorForIndex(java.lang.String label,
Type type)
|
java.util.Iterator<java.lang.String> |
getLabels()
Get all labels for all indexes. |
java.util.Iterator<java.lang.String> |
getLabels(FSIndexComparator comp)
Get the labels for a specific comparator. |
int[] |
getReindexedFSs()
|
boolean |
isCommitted()
Check if this instance has been committed. |
boolean |
isModified()
|
void |
ll_addFS(int fsRef)
Add a FS reference to all appropriate indexes in the repository. |
void |
ll_addFS(int fsRef,
boolean doChecks)
Add a FS reference to all appropriate indexes in the repository. |
LowLevelIndex |
ll_getIndex(java.lang.String indexName)
Get an index by its name. |
LowLevelIndex |
ll_getIndex(java.lang.String indexName,
int typeCode)
Get an index by a name and type. |
void |
ll_removeFS(int fsRef)
Remove a FS reference from all indexes in the repository. |
void |
removeFS(FeatureStructure fs)
Remove a feature structure from all indexes in the repository. |
void |
removeFS(int fsRef)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_INDEX_SIZE
| Method Detail |
|---|
public void flush()
public void addFS(int fsRef)
public void commit()
FSIndexRepositoryMgr
commit in interface FSIndexRepositoryMgrFSIndexRepositoryMgr.commit()public LinearTypeOrder getDefaultTypeOrder()
FSIndexRepositoryMgr
getDefaultTypeOrder in interface FSIndexRepositoryMgrpublic LinearTypeOrderBuilder getDefaultOrderBuilder()
FSIndexRepositoryMgr
getDefaultOrderBuilder in interface FSIndexRepositoryMgr
public boolean createIndex(FSIndexComparator comp,
java.lang.String label,
int indexType)
throws CASAdminException
FSIndexRepositoryMgr
createIndex in interface FSIndexRepositoryMgrcomp - The comparator for the new index.label - The name of the new index.indexType - The kind of index (sorted, set, bag).
false iff an index with the samelabel already exists.
CASAdminException - If the repository is locked (after calling commit()).FSIndexRepositoryMgr.createIndex(FSIndexComparator, String)
public boolean createIndexNoQuestionsAsked(FSIndexComparator comp,
java.lang.String label,
int indexType)
comp - label - indexType -
public java.util.Iterator<FSIndex<FeatureStructure>> getIndexes()
FSIndexRepository
getIndexes in interface FSIndexRepositoryFSIndexRepository.getIndexes()public java.util.Iterator<java.lang.String> getLabels()
FSIndexRepository
getLabels in interface FSIndexRepositoryFSIndexRepository.getLabels()public java.util.Iterator<java.lang.String> getLabels(FSIndexComparator comp)
comp - The comparator.
public FSIndex<FeatureStructure> getIndex(java.lang.String label,
Type type)
FSIndexRepository
getIndex in interface FSIndexRepositorylabel - The name of the index.type - A subtype of the type of the index.
null if an index with that name doesn't exist.FSIndexRepository.getIndex(String, Type)public FSIndex<FeatureStructure> getIndex(java.lang.String label)
FSIndexRepository
getIndex in interface FSIndexRepositorylabel - The name of the index.
label, or null if no such index
is defined.FSIndexRepository.getIndex(String)public IntPointerIterator getIntIteratorForIndex(java.lang.String label)
public IntPointerIterator getIntIteratorForIndex(java.lang.String label,
Type type)
public int getIndexSize(Type type)
public FSIndexComparator createComparator()
FSIndexRepositoryMgr
createComparator in interface FSIndexRepositoryMgrFSIndexRepositoryMgr.createComparator()public boolean isCommitted()
FSIndexRepositoryMgr
isCommitted in interface FSIndexRepositoryMgrtrue iff this instance has been committed.FSIndexRepositoryMgr.isCommitted()
public boolean createIndex(FSIndexComparator comp,
java.lang.String label)
throws CASAdminException
FSIndexRepositoryMgr
createIndex in interface FSIndexRepositoryMgrcomp - The comparator for the new index.label - The name of the new index.
false iff an index with the samelabel already exists.
CASAdminException - If the repository is locked (after calling commit()).FSIndexRepositoryMgr.createIndex(org.apache.uima.cas.admin.FSIndexComparator,
java.lang.String)public int[] getIndexedFSs()
public void addFS(FeatureStructure fs)
FSIndexRepository
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.
addFS in interface FSIndexRepositoryfs - The FS to be added.FSIndexRepository.addFS(org.apache.uima.cas.FeatureStructure)public void removeFS(FeatureStructure fs)
FSIndexRepository
removeFS in interface FSIndexRepositoryfs - The FS to be removed.FSIndexRepository.removeFS(org.apache.uima.cas.FeatureStructure)public void removeFS(int fsRef)
public LinearTypeOrderBuilder createTypeSortOrder()
FSIndexRepositoryMgr
createTypeSortOrder in interface FSIndexRepositoryMgrpublic LowLevelIndex ll_getIndex(java.lang.String indexName)
LowLevelIndexRepository
ll_getIndex in interface LowLevelIndexRepositoryindexName - The name of the index.
null if no such index exists.
public LowLevelIndex ll_getIndex(java.lang.String indexName,
int typeCode)
LowLevelIndexRepository
ll_getIndex in interface LowLevelIndexRepositoryindexName - The name of the index.typeCode - The code of the desired subtype.
null if no such index exists.
public final void ll_addFS(int fsRef,
boolean doChecks)
LowLevelIndexRepository
ll_addFS in interface LowLevelIndexRepositoryfsRef - The FS reference to be added to the repository. If fsRef is not a valid
FS reference, the subsequent behavior of the system is undefined.doChecks - Check if the FS reference argument is a valid reference.public void ll_addFS(int fsRef)
LowLevelIndexRepository
ll_addFS in interface LowLevelIndexRepositoryfsRef - The FS reference to be added to the repository. If fsRef is not a valid
FS reference, the subsequent behavior of the system is undefined.public void ll_removeFS(int fsRef)
LowLevelIndexRepository
ll_removeFS in interface LowLevelIndexRepositoryfsRef - The FS reference to be removed from the indexes.public FSIterator<FeatureStructure> getAllIndexedFS(Type type)
FSIndexRepositoryLimitation: If there are no sorted or bag indexes defined for this type, but there is more than one set index defined, then this method will only return the contents of one of these set indexes (chosen arbitrarily).
getAllIndexedFS in interface FSIndexRepositorytype - The type
aType,
in no particular order.public int[] getAddedFSs()
public int[] getDeletedFSs()
public int[] getReindexedFSs()
public boolean isModified()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||