|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.seq.db.TabIndexStore
Implements IndexStore as a serialized file for the java data and a tab-delimited file of offsets.
The tab-delimited file looks like:fileNumber \t offset \t id \n
Constructor Summary | |
TabIndexStore(java.io.File storeFile,
java.io.File indexFile,
java.lang.String name,
SequenceFormat format,
SequenceBuilderFactory sbFactory,
SymbolTokenization symbolParser)
|
Method Summary | |
protected void |
addFile(java.io.File f)
|
void |
commit()
Commit the stored indices to permanent storage. |
protected void |
commitStore()
|
Index |
fetch(java.lang.String id)
Fetch an Index based upon an ID. |
protected int |
getFileIndex(java.io.File file)
|
java.util.Set |
getFiles()
Retrieve the Set of files that are currently indexed. |
SequenceFormat |
getFormat()
Retrieve the format of the index file. |
java.util.Set |
getIDs()
Retrieve the set of all current IDs. |
java.lang.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. |
protected void |
initialize()
|
static TabIndexStore |
open(java.io.File storeFile)
|
void |
rollback()
Discard all uncommited changes. |
void |
store(Index indx)
Add the Index to the store. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TabIndexStore(java.io.File storeFile, java.io.File indexFile, java.lang.String name, SequenceFormat format, SequenceBuilderFactory sbFactory, SymbolTokenization symbolParser) throws java.io.IOException, BioException
Method Detail |
public static TabIndexStore open(java.io.File storeFile) throws java.io.IOException
java.io.IOException
public void store(Index indx) throws IllegalIDException, BioException
IndexStore
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.
store
in interface IndexStore
indx
- the Index to add
IllegalIDException
- if the index has an invalid ID field
BioException
- if the store failedpublic Index fetch(java.lang.String id) throws IllegalIDException, BioException
IndexStore
fetch
in interface IndexStore
id
- The ID of the sequence Index to retrieve
IllegalIDException
- if the ID couldn't be found
BioException
- if the fetch fails in the underlying storage mechanismpublic void commit() throws BioException
IndexStore
commit
in interface IndexStore
BioException
- if for any reason the commit failspublic void rollback()
IndexStore
rollback
in interface IndexStore
public java.lang.String getName()
IndexStore
getName
in interface IndexStore
public java.util.Set getIDs()
IndexStore
This set should either be immutable, or modifiable totally separately from the IndexStore.
getIDs
in interface IndexStore
public java.util.Set getFiles()
IndexStore
getFiles
in interface IndexStore
public SequenceFormat getFormat()
IndexStore
This set should either be immutable, or modifiable totally separately from the IndexStore.
getFormat
in interface IndexStore
public SequenceBuilderFactory getSBFactory()
IndexStore
getSBFactory
in interface IndexStore
public SymbolTokenization getSymbolParser()
IndexStore
getSymbolParser
in interface IndexStore
protected void commitStore() throws java.io.IOException
java.io.IOException
protected void addFile(java.io.File f)
protected int getFileIndex(java.io.File file)
protected void initialize() throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |