Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.uima.cas
Interface FSIndexRepository

All Known Subinterfaces:
  FSIndexRepositoryMgr

    public interface FSIndexRepository

Repository of indexes over feature structures. Use this interface to access previously defined indexes.

Method Summary
`void` | `addFS(FeatureStructure fs)` Add a feature structure to all appropriate indexes in the repository.
`FSIterator` | `getAllIndexedFS(Type aType)` Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its subtypes).
`FSIndex` | `getIndex(String label)` Retrieve an index according to a label.
`FSIndex` | `getIndex(String label, Type type)` Retrieve an index according to a label and a type.
`Iterator` | `getIndexes()` Get all indexes in this repository.
`Iterator` | `getLabels()` Get all labels for all indexes.
`void` | `removeFS(FeatureStructure fs)` Remove a feature structure from all indexes in the repository.

Method Detail

### getIndex

    FSIndex getIndex(String label)

  Retrieve an index according to a label.

  Parameters:
    `label` - The name of the index.
  Returns:
    The index with the name `label`, or `null` if no such index is defined.

### getIndex

    FSIndex getIndex(String label,
                     Type type)
                     throws CASRuntimeException

  Retrieve an index according to a label and a type. The type is used to narrow down the index of a more general type to a more specific one.

  Parameters:
    `label` - The name of the index.
    `type` - A subtype of the type of the index.
  Returns:
    The specified, or `null` if an index with that name doesn't exist.
  Throws:
    `CASRuntimeException` - When `type` is not a subtype of the index's type.

### getLabels

    Iterator getLabels()

  Get all labels for all indexes.

  Returns:
    All labels.

### getIndexes

    Iterator getIndexes()

  Get all indexes in this repository.

  Returns:
    All indexes.

### addFS

    void addFS(FeatureStructure fs)

  Add a feature structure to all appropriate indexes in the repository. If no indexes exist for the type of FS that you are adding, then a bag (unsorted) index will be automatically created.

  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.

  Parameters:
    `fs` - The FS to be added.
  Throws:
    `NullPointerException` - If the `fs` parameter is `null`.

### removeFS

    void removeFS(FeatureStructure fs)

  Remove a feature structure from all indexes in the repository.

  Parameters:
    `fs` - The FS to be removed.
  Throws:
    `NullPointerException` - If the `fs` parameter is `null`.

### getAllIndexedFS

    FSIterator getAllIndexedFS(Type aType)

  Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its subtypes).

  Limitation: 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).

  Parameters:
    `aType` - The type
  Returns:
    An iterator that returns all indexed FeatureStructures of type `aType`, in no particular order.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 The Apache Software Foundation. All Rights Reserved.