sonification.dataimport.visbards_resourcetoolkit.repository.resource
Interface ResourceReader

All Known Implementing Classes:
ResourceReaderCdf, ResourceReaderCombined, ResourceReaderMultifile

public interface ResourceReader

Defines methods that allow access to all the data of the reader.


Method Summary
 void close()
          Close the resource.
 void fastForward(double time)
          Fast forward to time x.
 Column[] getAllAvaliableColumns()
          Returns an array of avaliable columns (which will be present in each reading returned by this reader) NOTE: these columns may include but are not limited to those described in the resource info.
 java.lang.String getCentricity()
          Returns the centricity of this reader (Can be accessed while the resource is closed)
 ResourceInfo getInfo()
          Returns the resource info for this reader
 java.lang.String getName()
          Returns the name of this resource (Can be accessed while the resource is closed)
 int getNumReadings()
          Equivalent to getNumReadings(getTimeSpan()) (Can be accessed while the resource is closed)
 int getNumReadings(Range timeRange)
          Returns the number of readings in the time range specified.
 Range getTimespan()
          Returns the timespan of the resource.
 boolean hasNext()
          Returns true if another reading is avaliable.
 boolean isOpen()
          Returns true if the resource is currently open
 Reading next()
          Read and return the next reading in the resource.
 void open()
          Opens the files and "reset" the resource.
 Reading peekNext()
          Read the next reading but do not advance the reader forward
 double peekTime()
          Returns the time value of the "next" reading, Double.NaN if hasNext() is false
 void reset()
          Shifts the reader position to the start of the resource.
 void skip(int n)
          Skip the specified number of readings.
 

Method Detail

getName

java.lang.String getName()
Returns the name of this resource (Can be accessed while the resource is closed)


getCentricity

java.lang.String getCentricity()
Returns the centricity of this reader (Can be accessed while the resource is closed)


getTimespan

Range getTimespan()
Returns the timespan of the resource. (Can be accessed while the resource is closed)


getNumReadings

int getNumReadings()
Equivalent to getNumReadings(getTimeSpan()) (Can be accessed while the resource is closed)


getNumReadings

int getNumReadings(Range timeRange)
Returns the number of readings in the time range specified.


reset

void reset()
Shifts the reader position to the start of the resource. Next reading returned will be the first reading in the resource.


hasNext

boolean hasNext()
Returns true if another reading is avaliable.


getInfo

ResourceInfo getInfo()
Returns the resource info for this reader


getAllAvaliableColumns

Column[] getAllAvaliableColumns()
Returns an array of avaliable columns (which will be present in each reading returned by this reader) NOTE: these columns may include but are not limited to those described in the resource info. The reader may know how to identify useful columns within its resource and obtain the necessary metadata for them. Rely on this method whenever examining data from this reader. (Can be accessed while the resource is closed)


next

Reading next()
Read and return the next reading in the resource. null if hasNext() returns false.


peekNext

Reading peekNext()
Read the next reading but do not advance the reader forward


peekTime

double peekTime()
Returns the time value of the "next" reading, Double.NaN if hasNext() is false


skip

void skip(int n)
Skip the specified number of readings. skip(1) advances the reader one reading forward


fastForward

void fastForward(double time)
Fast forward to time x. After this call next() should return the first reading in the resource which occured after time x.


open

void open()
Opens the files and "reset" the resource.


isOpen

boolean isOpen()
Returns true if the resource is currently open


close

void close()
Close the resource. After the resource has been closed, open will need to be called before calling any other methods. Close resources to free memory and release files.