public class MetakitReader extends Object
Modifier and Type | Field and Description |
---|---|
private Column[][] |
columns |
private Object[][][] |
data |
private boolean |
littleEndian |
private int[] |
rowCount |
private RandomAccessInputStream |
stream |
private String[] |
tableNames |
Constructor and Description |
---|
MetakitReader(RandomAccessInputStream stream) |
MetakitReader(String file) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the reader and release any resources in use.
|
String[] |
getColumnNames(int tableIndex)
Retrieve the name of every column in the table with the given index.
|
String[] |
getColumnNames(String tableName)
Retrieve the name of every column in the named table.
|
Class[] |
getColumnTypes(int tableIndex)
Retrieve the type for every column in the table with the given index.
|
Class[] |
getColumnTypes(String tableName)
Retrieve the type for every column in the named table.
|
int |
getRowCount(int tableIndex)
Retrieve the number of rows in the table with the given index.
|
int |
getRowCount(String tableName)
Retrieve the number of rows in the named table.
|
Object[] |
getRowData(int rowIndex,
int tableIndex)
Retrieve the given row of data from the table with the given index.
|
Object[] |
getRowData(int rowIndex,
String tableName)
Retrieve the given row of data from the named table.
|
int |
getTableCount()
Retrieve the number of tables in this database file.
|
Object[][] |
getTableData(int tableIndex)
Retrieve all of the tabular data for the table with the given index.
|
Object[][] |
getTableData(String tableName)
Retrieve all of the tabular data for the named table.
|
String[] |
getTableNames()
Retrieve the name of every table in this database file.
|
private void |
initialize()
Read the tables for the current database file.
|
private void |
readFooter()
Read the footer data for the current database file.
|
private void |
readTOC()
Reads the table of contents (TOC) for the current database file.
|
private RandomAccessInputStream stream
private String[] tableNames
private Column[][] columns
private int[] rowCount
private Object[][][] data
private boolean littleEndian
public MetakitReader(String file) throws IOException, MetakitException
IOException
MetakitException
public MetakitReader(RandomAccessInputStream stream) throws MetakitException
MetakitException
public void close()
public int getTableCount()
public String[] getTableNames()
getTableCount()
.public String[] getColumnNames(int tableIndex)
getTableCount()
- 1
.public String[] getColumnNames(String tableName)
public Class[] getColumnTypes(int tableIndex)
getTableCount()
- 1
.
Every Object in the arrays returned by getTableData(int)
and
getTableData(String)
will be an instance of the corresponding
Class in the Class[] returned by this method.public Class[] getColumnTypes(String tableName)
getTableData(int)
and
getTableData(String)
will be an instance of the corresponding
Class in the Class[] returned by this method.public int getRowCount(int tableIndex)
getTableCount()
- 1
.public int getRowCount(String tableName)
public Object[][] getTableData(int tableIndex)
getTableCount()
- 1
.getColumnTypes(int)
public Object[][] getTableData(String tableName)
getColumnTypes(String)
public Object[] getRowData(int rowIndex, int tableIndex)
getTableCount()
- 1
.getColumnTypes(int)
public Object[] getRowData(int rowIndex, String tableName)
getColumnTypes(String)
private void initialize() throws IOException, MetakitException
IOException
- if the file could not be readMetakitException
- if the file is not valid for the Metakit formatprivate void readFooter() throws IOException, MetakitException
IOException
- if the footer cannot be read from the fileMetakitException
- if the footer is not valid for the Metakit formatprivate void readTOC() throws IOException, MetakitException
IOException
- if the footer cannot be read from the fileMetakitException
- if the footer is not valid for the Metakit formatCopyright © 2016 Open Microscopy Environment