## org.biojava.bio.seq.db
Interface IndexStore

All Known Implementing Classes:
  BioIndex, EmblCDROMIndexStore, TabIndexStore

    public interface IndexStore

This defines the objects that IndexedSequenceDB uses to store all of the database state, such as name, format, sequence builder and the actual file offsets. You should only ever have to instantiate an implementation of this. Don't call any of the inerface methods directly. They are intended for IndexedSequenceDB, not you. In general, these objects should be transactional. Calls to store should add the index to temporary storage. When commit is invoked, these indices should all be added to the permanent storage. When rollback is invoked, these indexes should be discarded. If commit fails for any reason, it should leave the permanent storage in the pre-commit status.

Author:
  Matthew Pocock

Method Summary
`void` `commit()` Commit the stored indices to permanent storage.
`Index` `fetch(String id)` Fetch an Index based upon an ID.
`Set` `getFiles()` Retrieve the Set of files that are currently indexed.
`SequenceFormat` `getFormat()` Retrieve the format of the index file.
`Set` `getIDs()` Retrieve the set of all current IDs.
`String` `getName()` Retrieve the name of this store.
`SequenceBuilderFactory` `getSBFactory()` Retrieve the SequenceBuilderFactory used to build Sequence instances.
`SymbolTokenization` `getSymbolParser()` Retrieve the symbol parser used to turn the sequence characters into Symobl objects.
`void` `rollback()` Discard all uncommited changes.
`void` `store(Index indx)` Add the Index to the store.

Method Detail

### store

    void store(Index indx)
               throws IllegalIDException,
                      BioException

  Add the Index to the store.

  This method should be transactional. If the store fails, the IndexStore should be left in its original state.

  If the file of the Index is not known yet, it is the responsibility of the IndexStore to add it to the set returned by getFiles.

  Parameters:
    `indx` - the Index to add
  Throws:
    `IllegalIDException` - if the index has an invalid ID field
    `BioException` - if the store failed

### commit

    void commit()
                throws BioException

  Commit the stored indices to permanent storage.

  Throws:
    `BioException` - if for any reason the commit fails

### rollback

    void rollback()

  Discard all uncommited changes.

### fetch

    Index fetch(String id)
                throws IllegalIDException,
                       BioException

  Fetch an Index based upon an ID.

  Parameters:
    `id` - The ID of the sequence Index to retrieve
  Throws:
    `IllegalIDException` - if the ID couldn't be found
    `BioException` - if the fetch fails in the underlying storage mechanism

### getName

    String getName()

  Retrieve the name of this store. This will be reflected as the name of the IndexedSequenceDB.

  Returns:
    the String name of the index

### getIDs

    Set getIDs()

  Retrieve the set of all current IDs.

  This set should either be immutable, or modifiable totally separately from the IndexStore.

  Returns:
    a Set of all legal IDs

### getFiles

    Set getFiles()

  Retrieve the Set of files that are currently indexed.

### getFormat

    SequenceFormat getFormat()

  Retrieve the format of the index file.

  This set should either be immutable, or modifiable totally separately from the IndexStore.

  Returns:
    a Set of all indexed files

### getSBFactory

    SequenceBuilderFactory getSBFactory()

  Retrieve the SequenceBuilderFactory used to build Sequence instances.

  Returns:
    the associated SequenceBuilderFactory

### getSymbolParser

    SymbolTokenization getSymbolParser()

  Retrieve the symbol parser used to turn the sequence characters into Symobl objects.

  Returns:
    the associated SymbolParser