Package org.biojava.bio.program.indexdb
Class BioStore
java.lang.Object
org.biojava.bio.program.indexdb.BioStore
- All Implemented Interfaces:
IndexStore
BioStores 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 TypeMethodDescriptionvoidcommit()commitwrites an index to disk.getreturns a record specified by a primary identifier.getreturns a list ofRecords by searching against the primary identifiers if the namespace argument is equal to the primary namespace or otherwise by searching the secondary namespaces.getLocationreturns the directory where the index is located.getMetaDatareturns 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.getRecordListreturns all theRecords in the index.voidwriteRecord(RAF file, long offset, int length, String id, Map secIDs) writeRecordcreates and writes a newRecord
-
Constructor Details
-
BioStore
Creates a newBioStoreflatfile index at the specified location with the specified caching behaviour.- Parameters:
location- aFileindicating the index directory.cache- abooleanindicating 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
getLocationreturns the directory where the index is located.- Returns:
- a
File.
-
getMetaData
Description copied from interface:IndexStoregetMetaDatareturns a data structure which represents an OBDA "config.dat" flatfile indexing configuration file.- Specified by:
getMetaDatain interfaceIndexStore- Returns:
- an
Annotation.
-
get
Description copied from interface:IndexStoregetreturns a record specified by a primary identifier.- Specified by:
getin interfaceIndexStore- Parameters:
id- aStringprimary ID.- Returns:
- a
Record.
-
get
Description copied from interface:IndexStoregetreturns a list ofRecords 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:
getin interfaceIndexStore- Parameters:
id- aStringprimary ID.namespace- aString.- Returns:
- a
ListofRecords. - Throws:
BioException- if an error occurs.
-
writeRecord
Description copied from interface:IndexStorewriteRecordcreates and writes a newRecord- Specified by:
writeRecordin interfaceIndexStore- Parameters:
file- aRAFfile.offset- alongbyte offset.length- anintbyte record length.id- aStringprimary ID.secIDs- aMapof primary ID to aListof secondary IDs.
-
getRecordList
getRecordListreturns all theRecords in the index.- Returns:
- a
ListofRecords.
-
commit
commitwrites an index to disk.- Throws:
CommitFailure- if an error occurs.
-