public class IlvVMAPTable extends Object
IlvVMAPTable encapsulates a VMAP table and reads records from
it.| Constructor and Description |
|---|
IlvVMAPTable(String fileName)
Constructs an
IlvVMAPTable object from the specified
filename. |
| Modifier and Type | Method and Description |
|---|---|
void |
closeVMAPDataInput()
Closes the underlying data connection.
|
int |
getColumnCount()
Returns the number of columns in this table.
|
int |
getColumnIndex(String columnName)
Returns the index of the column with the name specified.
|
AbstractColumnInfo |
getColumnInfo(int columnIndex)
Returns the
AbstractColumnInfo object for a specified
column index. |
String |
getColumnName(int columnIndex)
Returns the name of a specified column.
|
String |
getFileName()
Returns the filename for this table.
|
Object[] |
getRecord(int recordIndex)
Returns the record for the index specified.
|
int |
getRecordCount()
Returns the number of records in this table.
|
Object |
getRecordFieldByIndex(int recordIndex,
int fieldIndex)
Returns the value of a particular column, specified by its index for a
specific record.
|
Object |
getRecordFieldByName(int recordIndex,
String fieldName)
Returns the value of a particular column, specified by name for a
specific record.
|
boolean |
isLSBFirst()
Returns
true if this table has least significant byte
first encoding. |
double |
readDouble(IlvVMAPDataInput VMAPDataInput)
Reads a
double instance (8 bytes) from the specified
stream, according to the byte order of this table. |
float |
readFloat(IlvVMAPDataInput VMAPDataInput)
Read a
float instance (4 bytes) from the specified stream,
according to the byte order of this table. |
int |
readInt(byte[] byteArray)
Reads an integer from a byte array (length must be >= 4), according to
the byte order specified in this table.
|
int |
readInt(IlvVMAPDataInput VMAPDataInput)
Reads an
int object (4 bytes) from the specified stream,
according to the byte order of this table. |
long |
readLong(IlvVMAPDataInput VMAPDataInput)
Reads a
long instance (8 bytes) from the specified stream,
according to the byte order of this table. |
short |
readShort(IlvVMAPDataInput VMAPDataInput)
Reads a
short object (2 bytes) from the specified stream,
according to the byte order of this table. |
void |
readTable(boolean fullyRead)
Constructs this
IlvVMAPTable object by reading attributes
from the associated file. |
int |
searchRecordByColumnValue(int columnIndex,
Object value)
Search for the first record encountered that contains a specified value
for a specific column.
|
public IlvVMAPTable(String fileName)
IlvVMAPTable object from the specified
filename.fileName - The filename to read the table from.public String getFileName()
public boolean isLSBFirst()
true if this table has least significant byte
first encoding.true is returned.public void readTable(boolean fullyRead)
throws IOException,
IlvVMAPFormatException
IlvVMAPTable object by reading attributes
from the associated file.fullyRead - If true, the whole table is loaded into
memory, otherwise records are read on demand.IOExceptionIlvVMAPFormatExceptionpublic void closeVMAPDataInput()
throws IOException
IOExceptionpublic int readInt(byte[] byteArray)
byteArray - The byte array (4 bytes) from which to read an integer.int value of this array.public int readInt(IlvVMAPDataInput VMAPDataInput) throws IOException
int object (4 bytes) from the specified stream,
according to the byte order of this table.VMAPDataInput - The VMAP data input to read from.IOExceptionpublic short readShort(IlvVMAPDataInput VMAPDataInput) throws IOException
short object (2 bytes) from the specified stream,
according to the byte order of this table.VMAPDataInput - The VMAP data input to read from.IOExceptionpublic long readLong(IlvVMAPDataInput VMAPDataInput) throws IOException
long instance (8 bytes) from the specified stream,
according to the byte order of this table.VMAPDataInput - The VMAP data input to read from.IOExceptionpublic float readFloat(IlvVMAPDataInput VMAPDataInput) throws IOException
float instance (4 bytes) from the specified stream,
according to the byte order of this table.VMAPDataInput - The VMAP data input to read from.IOExceptionpublic double readDouble(IlvVMAPDataInput VMAPDataInput) throws IOException
double instance (8 bytes) from the specified
stream, according to the byte order of this table.VMAPDataInput - The VMAP data input to read from.IOExceptionpublic Object[] getRecord(int recordIndex) throws IOException, IlvVMAPFormatException
recordIndex - The index of the record.recordIndex is
out of bounds, null is returned.IOExceptionIlvVMAPFormatExceptionpublic Object getRecordFieldByName(int recordIndex, String fieldName) throws IOException, IlvVMAPFormatException
recordIndex - The index of the record.fieldName - The field name.IOExceptionIlvVMAPFormatExceptionpublic Object getRecordFieldByIndex(int recordIndex, int fieldIndex) throws IOException, IlvVMAPFormatException
recordIndex - The record index.fieldIndex - The field index.IOExceptionIlvVMAPFormatExceptionpublic int searchRecordByColumnValue(int columnIndex,
Object value)
throws IOException,
IlvVMAPFormatException
Note: this implementation is slow.
columnIndex - The column index.value - The value to search for.IOExceptionIlvVMAPFormatExceptionpublic int getColumnCount()
public String getColumnName(int columnIndex)
columnIndex - The column index.public AbstractColumnInfo getColumnInfo(int columnIndex)
AbstractColumnInfo object for a specified
column index.columnIndex - The column index.public int getColumnIndex(String columnName)
columnName - The column name.-1 is returned.spublic int getRecordCount()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.