sonification.dataimport.visbards_resourcetoolkit.repository.resource
Class ResourceReaderCdf

java.lang.Object
  extended by sonification.dataimport.visbards_resourcetoolkit.repository.resource.ResourceReaderCdf
All Implemented Interfaces:
ResourceReader

public class ResourceReaderCdf
extends java.lang.Object
implements ResourceReader


Constructor Summary
ResourceReaderCdf(java.io.File file, ResourceInfo info)
           
 
Method Summary
 void close()
          Close the resource (reset will need to be called again before reading again)
 void fastForward(double time)
          Move forward in the CDF file to the record with the specified time stamp.
 Column[] getAllAvaliableColumns()
          Returns an array of avaliable columns (which will be presetn in reading)
 java.lang.String getCentricity()
          Returns the centricity of this reader
 ResourceInfo getInfo()
          Returns the resource info for this reader
 java.lang.String getName()
          This method is declared in the ResourceReader interface.
 int getNumReadings()
          Equivalent to getNumReadings(getTimeSpan()) (Can be accessed while the resource is closed)
 int getNumReadings(Range timerng)
          This method is declared in the ResourceReader interface.
 Range getTimespan()
          This method is declared in the ResourceReader interface.
 boolean hasNext()
          This method is declared in the ResourceReader interface.
 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()
          Reset the class so that a subsequent call to next() will return the first record in the CDF.
 void skip(int n)
          Skip forward in the CDF by 'n' records.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceReaderCdf

public ResourceReaderCdf(java.io.File file,
                         ResourceInfo info)
                  throws SonificationException
Throws:
SonificationException
Method Detail

getInfo

public ResourceInfo getInfo()
Description copied from interface: ResourceReader
Returns the resource info for this reader

Specified by:
getInfo in interface ResourceReader

getAllAvaliableColumns

public Column[] getAllAvaliableColumns()
Returns an array of avaliable columns (which will be presetn in reading)

Specified by:
getAllAvaliableColumns in interface ResourceReader

getCentricity

public java.lang.String getCentricity()
Returns the centricity of this reader

Specified by:
getCentricity in interface ResourceReader

getNumReadings

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

Specified by:
getNumReadings in interface ResourceReader

getNumReadings

public int getNumReadings(Range timerng)
This method is declared in the ResourceReader interface.

Specified by:
getNumReadings in interface ResourceReader

next

public Reading next()
Description copied from interface: ResourceReader
Read and return the next reading in the resource. null if hasNext() returns false.

Specified by:
next in interface ResourceReader

peekNext

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

Specified by:
peekNext in interface ResourceReader

peekTime

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

Specified by:
peekTime in interface ResourceReader

skip

public void skip(int n)
Skip forward in the CDF by 'n' records.
This method is declared in the ResourceReader interface.

Specified by:
skip in interface ResourceReader

fastForward

public void fastForward(double time)
Move forward in the CDF file to the record with the specified time stamp. If that exact timestamp does not exist in the file, move forward to the largest timestamp in the file that is less than the requested timestamp.
This method is declared in the ResourceReader interface.

Specified by:
fastForward in interface ResourceReader

getName

public java.lang.String getName()
This method is declared in the ResourceReader interface.

Specified by:
getName in interface ResourceReader

getTimespan

public Range getTimespan()
This method is declared in the ResourceReader interface.

Specified by:
getTimespan in interface ResourceReader

reset

public void reset()
Reset the class so that a subsequent call to next() will return the first record in the CDF.
This method is declared in the ResourceReader interface.

Specified by:
reset in interface ResourceReader

hasNext

public boolean hasNext()
This method is declared in the ResourceReader interface.

Specified by:
hasNext in interface ResourceReader

open

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

Specified by:
open in interface ResourceReader

isOpen

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

Specified by:
isOpen in interface ResourceReader

close

public void close()
Close the resource (reset will need to be called again before reading again)

Specified by:
close in interface ResourceReader