Package org.biojava.bio.program.indexdb
Class BioStore
java.lang.Object
org.biojava.bio.program.indexdb.BioStore
- All Implemented Interfaces:
IndexStore
BioStore
s represent directory and file structures
which index flat files according to the OBDA specification. The
preferred method of constructing new instances is to use
BioStoreFactory
.- Author:
- Matthew Pocock, Keith James
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
commit
writes an index to disk.get
returns a record specified by a primary identifier.get
returns a list ofRecord
s by searching against the primary identifiers if the namespace argument is equal to the primary namespace or otherwise by searching the secondary namespaces.getLocation
returns the directory where the index is located.getMetaData
returns a data structure which represents an OBDA "config.dat" flatfile indexing configuration file.getName()
The name of this store or null if the name has not been set.getRecordList
returns all theRecord
s in the index.void
writeRecord
(RAF file, long offset, int length, String id, Map secIDs) writeRecord
creates and writes a newRecord
-
Constructor Details
-
BioStore
Creates a newBioStore
flatfile index at the specified location with the specified caching behaviour.- Parameters:
location
- aFile
indicating the index directory.cache
- aboolean
indicating whether the implementation should cache its state.- Throws:
IOException
- if an error occurs.BioException
- if an error occurs.
-
-
Method Details
-
getName
The name of this store or null if the name has not been set. -
getLocation
getLocation
returns the directory where the index is located.- Returns:
- a
File
.
-
getMetaData
Description copied from interface:IndexStore
getMetaData
returns a data structure which represents an OBDA "config.dat" flatfile indexing configuration file.- Specified by:
getMetaData
in interfaceIndexStore
- Returns:
- an
Annotation
.
-
get
Description copied from interface:IndexStore
get
returns a record specified by a primary identifier.- Specified by:
get
in interfaceIndexStore
- Parameters:
id
- aString
primary ID.- Returns:
- a
Record
.
-
get
Description copied from interface:IndexStore
get
returns a list ofRecord
s by searching against the primary identifiers if the namespace argument is equal to the primary namespace or otherwise by searching the secondary namespaces. The list of Record instances retuned may be empty, but is never null.- Specified by:
get
in interfaceIndexStore
- Parameters:
id
- aString
primary ID.namespace
- aString
.- Returns:
- a
List
ofRecord
s. - Throws:
BioException
- if an error occurs.
-
writeRecord
Description copied from interface:IndexStore
writeRecord
creates and writes a newRecord
- Specified by:
writeRecord
in interfaceIndexStore
- Parameters:
file
- aRAF
file.offset
- along
byte offset.length
- anint
byte record length.id
- aString
primary ID.secIDs
- aMap
of primary ID to aList
of secondary IDs.
-
getRecordList
getRecordList
returns all theRecord
s in the index.- Returns:
- a
List
ofRecord
s.
-
commit
commit
writes an index to disk.- Throws:
CommitFailure
- if an error occurs.
-