sonification.dataimport.visbards_resourcetoolkit.repository.resource
Class ResourceReaderMultifile

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

public class ResourceReaderMultifile
extends java.lang.Object
implements ResourceReader


Constructor Summary
ResourceReaderMultifile(ResourceInfo info)
           
 
Method Summary
 void addResourceReader(ResourceReader reader)
           
 void close()
          Close the resource.
 void fastForward(double time)
          Fast forward to time x.
 Column[] getAllAvaliableColumns()
          Returns an array of avaoiable 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()
          Returns the name of this resource
 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()
          Returns the time value of the "next" reading, Double.NaN if hasNext() is false
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceReaderMultifile

public ResourceReaderMultifile(ResourceInfo info)
Method Detail

getName

public java.lang.String getName()
Returns the name of this resource

Specified by:
getName in interface ResourceReader

getInfo

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

Specified by:
getInfo in interface ResourceReader

getCentricity

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

Specified by:
getCentricity in interface ResourceReader

getAllAvaliableColumns

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

Specified by:
getAllAvaliableColumns in interface ResourceReader

getTimespan

public Range getTimespan()
Returns the timespan of the resource.

Specified by:
getTimespan 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 timeRange)
Returns the number of readings in the time range specified.

Specified by:
getNumReadings in interface ResourceReader

reset

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

Specified by:
reset in interface ResourceReader

hasNext

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

Specified by:
hasNext in interface ResourceReader

next

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

Specified by:
next in interface ResourceReader

peekNext

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

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 the specified number of readings. Skip one advances the reader one reading forward

Specified by:
skip in interface ResourceReader

fastForward

public 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.

Specified by:
fastForward in interface ResourceReader

addResourceReader

public void addResourceReader(ResourceReader reader)
                       throws SonificationException
Throws:
SonificationException

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()
Description copied from interface: ResourceReader
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.

Specified by:
close in interface ResourceReader