Class JDB2Reader
java.lang.Object
com.pnfsoftware.jeb.core.dao.impl.JDB2Reader
- All Implemented Interfaces:
IFileDatabaseReader,Closeable,AutoCloseable
JDB2 (JEB saved project database) record reader.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDescription of a JDB2 record located in a database file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Retrieve the backing file, if any.intRetrieve the version-integer of the JEB build that originally created the JDB2 database.getRecord(int type) Retrieve a record.Retrieve a record.getRecordDescription(int type) Retrieve the description of a record of a given type.Retrieve the descriptions of all records contained in the database.booleanDetermine if this database is backed by a file.
-
Constructor Details
-
JDB2Reader
Open a JDB2 reader on a database file.- Parameters:
f- JDB2 file- Throws:
IOException- if the file cannot be opened or does not start with a valid JDB2 header
-
-
Method Details
-
getJebVersionInt
public int getJebVersionInt()Retrieve the version-integer of the JEB build that originally created the JDB2 database. On older JDB2, this value is not set and will be 0. If a non-zero value is returned, it can be converted to a partial version object usingVersion.fromInt(int).- Returns:
- the originating JEB version encoded as an integer
-
hasBackingFile
public boolean hasBackingFile()Description copied from interface:IFileDatabaseReaderDetermine if this database is backed by a file.- Specified by:
hasBackingFilein interfaceIFileDatabaseReader- Returns:
trueif a backing file is available
-
getBackingFile
Description copied from interface:IFileDatabaseReaderRetrieve the backing file, if any.- Specified by:
getBackingFilein interfaceIFileDatabaseReader- Returns:
- the backing file
-
getRecordDescriptions
Description copied from interface:IFileDatabaseReaderRetrieve the descriptions of all records contained in the database.- Specified by:
getRecordDescriptionsin interfaceIFileDatabaseReader- Returns:
- the record descriptions in storage order
-
getRecordDescription
Description copied from interface:IFileDatabaseReaderRetrieve the description of a record of a given type.- Specified by:
getRecordDescriptionin interfaceIFileDatabaseReader- Parameters:
type- record type- Returns:
- the matching record description, or
nullif no such record exists
-
getRecord
Description copied from interface:IFileDatabaseReaderRetrieve a record.- Specified by:
getRecordin interfaceIFileDatabaseReader- Parameters:
type- record type- Returns:
- record data stream
- Throws:
IOException- if the record could not be retrieved
-
getRecord
Description copied from interface:IFileDatabaseReaderRetrieve a record.- Specified by:
getRecordin interfaceIFileDatabaseReader- Parameters:
r- record description- Returns:
- record data stream
- Throws:
IOException- if the record could not be retrieved
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-