|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.washington.NVisF.dataIO.DataReader | +--edu.washington.NVisF.dataIO.BinaryDataFileReader
BinaryDataFileReader extends DataReader to support readers of binary data files, providing simple implementations of the connection and meta-info methods. A subclass only needs to provide one initConnection() method (which usually reads the data from file into memory, and must create the TypeInfo object) and the data access methods.
Constructor Summary | |
BinaryDataFileReader()
|
Method Summary | |
void |
closeConnection()
does whatever work is needed to close the connection |
abstract int |
getCount(java.lang.String predicate)
returns the number of objects that satisfy the given predicate. |
abstract float[] |
getScalar(java.lang.String predicate,
java.lang.String dataField)
returns an array of floats containing the specified scalar field element for all data objects that satisfy the given predicate. |
TypeInfo |
getTypeInfo()
retrieves a description of the data available from this source as a TypeInfo object. |
abstract float[][] |
getVector(java.lang.String predicate,
java.lang.String dataField)
returns an array of arrays containing the specified vector field element for all data objects that satisfy the given predicate. |
abstract void |
initConnection(java.io.InputStream in)
|
void |
initConnection(java.lang.String source)
initiates a connection to the data source represented by the given String. |
void |
initConnection(java.net.URL source)
initiates a connection to the data source represented by the given URL. |
boolean |
isConnectionOpen()
tests whether an active connection exists |
abstract void |
loadData(java.lang.String predicate,
java.lang.String[] dataFields)
instructs this DataReader to gather and store the requested data for later access. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BinaryDataFileReader()
Method Detail |
public boolean isConnectionOpen()
DataReader
isConnectionOpen
in class DataReader
edu.washington.NVisF.dataIO.DataReader
public void initConnection(java.lang.String source) throws OpenConnectionException, SourceNotFoundException, DataIOException
DataReader
initConnection
in class DataReader
edu.washington.NVisF.dataIO.DataReader
source
- a string specifying the location of the data sourceOpenConnectionException
- if a connection is already establishedSourceNotFoundException
- if the specified resource could not be foundDataIOException
- if the attempt to open the connection failspublic void initConnection(java.net.URL source) throws OpenConnectionException, SourceNotFoundException, DataIOException
DataReader
initConnection
in class DataReader
edu.washington.NVisF.dataIO.DataReader
source
- a URL specifying the location of the data sourceOpenConnectionException
- if a connection is already establishedSourceNotFoundException
- if the specified resource could not be foundDataIOException
- if the attempt to open the connection failspublic abstract void initConnection(java.io.InputStream in) throws DataIOException
public void closeConnection() throws NoConnectionException, DataIOException
DataReader
closeConnection
in class DataReader
edu.washington.NVisF.dataIO.DataReader
NoConnectionException
- if there is no active connectionDataIOException
- if the attempt to close the connection failspublic TypeInfo getTypeInfo() throws NoConnectionException
DataReader
getTypeInfo
in class DataReader
edu.washington.NVisF.dataIO.DataReader
NoConnectionException
- if there is no ative connectionTypeInfo
public abstract int getCount(java.lang.String predicate) throws java.text.ParseException, NoConnectionException, DataIOException
DataReader
getCount
in class DataReader
edu.washington.NVisF.dataIO.DataReader
predicate
- a string in the query language that identifies
the desired objectsjava.text.ParseException
- if the predicate cannot be parsedNoConnectionException
- if there is no active connectionDataIOException
- if an unexpected error occurspublic abstract void loadData(java.lang.String predicate, java.lang.String[] dataFields) throws java.text.ParseException, NoConnectionException, DataIOException
DataReader
loadData
in class DataReader
edu.washington.NVisF.dataIO.DataReader
predicate
- a string in the query language that identifies
the desired objectsfields
- an array of strings giving the names of the
desired fieldsjava.text.ParseException
- if the predicate cannot be parsedNoConnectionException
- if there is no active connectionDataIOException
- if an unexpected error occursDataReader.getScalar(java.lang.String, java.lang.String)
,
DataReader.getVector(java.lang.String, java.lang.String)
public abstract float[] getScalar(java.lang.String predicate, java.lang.String dataField) throws java.text.ParseException, NoConnectionException, DataIOException
DataReader
getScalar
in class DataReader
edu.washington.NVisF.dataIO.DataReader
predicate
- a string in the query language that identifies
the desired objectsdataField
- a string specifying the scalar field to be returnedjava.text.ParseException
- if the predicate cannot be parsedNoConnectionException
- if there is no active connectionDataIOException
- if an unexpected error occursDataReader.loadData(java.lang.String, java.lang.String[])
public abstract float[][] getVector(java.lang.String predicate, java.lang.String dataField) throws java.text.ParseException, NoConnectionException, DataIOException
DataReader
getVector
in class DataReader
edu.washington.NVisF.dataIO.DataReader
predicate
- a string in the query language that identifies
the desired objectsdataField
- a string specifying the vector field to be returnedjava.text.ParseException
- if the predicate cannot be parsedNoConnectionException
- if there is no active connectionDataIOException
- if an unexpected error occursDataReader.loadData(java.lang.String, java.lang.String[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |