Package loci.formats.services
Class MDBServiceImpl
java.lang.Object
loci.common.services.AbstractService
loci.formats.services.MDBServiceImpl
- All Implemented Interfaces:
loci.common.services.Service,MDBService
Implementation of
MDBService for parsing MDB database files.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Vector<mdbtools.libmdb.Holder> private mdbtools.libmdb.MdbHandle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the currently initialized file.private booleanfetchRow(mdbtools.libmdb.MdbTableDef table) Fetches the next row from the table, ignoring potential parsing exceptions.voidinitialize(String filename) Prepare the given .mdb file for reading.Read all tables from a pre-initialized .mdb files.parseTable(String name) Read named table from a pre-initialized .mdb files.Methods inherited from class loci.common.services.AbstractService
checkClassDependency
-
Field Details
-
mdb
private mdbtools.libmdb.MdbHandle mdb -
boundValues
-
-
Constructor Details
-
MDBServiceImpl
public MDBServiceImpl()Default constructor.
-
-
Method Details
-
initialize
Description copied from interface:MDBServicePrepare the given .mdb file for reading. This method must be called beforeMDBService.parseDatabase().- Specified by:
initializein interfaceMDBService- Throws:
IOException- if a problem occurs when opening the file
-
parseDatabase
Description copied from interface:MDBServiceRead all tables from a pre-initialized .mdb files. Each Vector<String[]> in the outer Vector represents a table; each String[] in a table represents a row, and each element of the String[] represents the value of a particular column within the row. The first row in each table contains the names for each column. The first entry in the column name row is the name of the table.MDBService.initialize(String)must be called before calling parseDatabase().- Specified by:
parseDatabasein interfaceMDBService- Throws:
IOException- if there is a problem reading the table data
-
parseTable
Description copied from interface:MDBServiceRead named table from a pre-initialized .mdb files. Each String[] in a table represents a row, and each element of the String[] represents the value of a particular column within the row. The first row in the table contains the names for each column.MDBService.initialize(String)must be called before calling parseTable.- Specified by:
parseTablein interfaceMDBService- Parameters:
name- table name- Returns:
- table data or null if the named table does not exist
- Throws:
IOException- if there is a problem reading the table data
-
close
public void close()Description copied from interface:MDBServiceClose the currently initialized file.- Specified by:
closein interfaceMDBService
-
fetchRow
private boolean fetchRow(mdbtools.libmdb.MdbTableDef table) Fetches the next row from the table, ignoring potential parsing exceptions.- Parameters:
table- Table to fetch the next available row from.- Returns:
trueif there are further rows to fetch.falseif there are no further rows to fetch or an exception is thrown while parsing the row.
-