public class BioIndex extends Object implements IndexStore
This class may not be thread-safe.
| Constructor and Description |
|---|
BioIndex(File indexDirectory)
Load an existing index file.
|
BioIndex(File indexDirectory,
String namespace,
int idLength) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
int |
guessRecLen(RandomAccessFile file) |
void |
rollback()
Discard all uncommited changes.
|
void |
store(Index indx)
Add the Index to the store.
|
public BioIndex(File indexDirectory, String namespace, int idLength) throws IOException, BioException
IOExceptionBioExceptionpublic BioIndex(File indexDirectory) throws IOException, BioException
IOExceptionBioExceptionpublic String getName()
IndexStoregetName in interface IndexStorepublic int guessRecLen(RandomAccessFile file) throws IOException
IOExceptionpublic Index fetch(String id) throws IllegalIDException, BioException
IndexStorefetch in interface IndexStoreid - The ID of the sequence Index to retrieveIllegalIDException - if the ID couldn't be foundBioException - if the fetch fails in the underlying storage mechanismpublic void store(Index indx)
IndexStoreThis 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.
store in interface IndexStoreindx - the Index to addpublic void commit() throws BioException
IndexStorecommit in interface IndexStoreBioException - if for any reason the commit failspublic void rollback()
IndexStorerollback in interface IndexStorepublic Set getIDs()
IndexStoreThis set should either be immutable, or modifiable totally separately from the IndexStore.
getIDs in interface IndexStorepublic Set getFiles()
IndexStoregetFiles in interface IndexStorepublic SequenceFormat getFormat()
IndexStoreThis set should either be immutable, or modifiable totally separately from the IndexStore.
getFormat in interface IndexStorepublic SequenceBuilderFactory getSBFactory()
IndexStoregetSBFactory in interface IndexStorepublic SymbolTokenization getSymbolParser()
IndexStoregetSymbolParser in interface IndexStoreCopyright © 2020 BioJava. All rights reserved.