org.openmuc.mux.dbprovider.slotsdb
Class FileObject

java.lang.Object
  extended by org.openmuc.mux.dbprovider.slotsdb.FileObject

public class FileObject
extends java.lang.Object


Constructor Summary
FileObject(java.io.File file)
           
FileObject(java.lang.String filename)
           
 
Method Summary
 void append(double value, long timestamp, byte flag)
           
 void close()
          Closes and Flushes underlying Input- and OutputStreams
 void createFileAndHeader(long startTimeStamp, long stepIntervall)
          creates the file, if it doesn't exist.
 void flush()
          Flushes the underlying Data Streams.
 long getStartTimeStamp()
          Return the Timestamp of the first stored Value in this File.
 long getStoringPeriod()
           
 long getTimestampForLatestValue()
           
 Value read(long timestamp)
           
 java.util.List<Value> read(long start, long end)
          Returns a List of Value Objects containing the measured Values between provided start and end timestamp
 java.util.List<Value> readFully()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileObject

public FileObject(java.lang.String filename)
           throws java.io.IOException
Throws:
java.io.IOException

FileObject

public FileObject(java.io.File file)
           throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getStartTimeStamp

public long getStartTimeStamp()
Return the Timestamp of the first stored Value in this File.


getStoringPeriod

public long getStoringPeriod()
Returns:
step frequency in seconds

createFileAndHeader

public void createFileAndHeader(long startTimeStamp,
                                long stepIntervall)
                         throws java.io.IOException
creates the file, if it doesn't exist.

Parameters:
startTimeStamp - for file header
Throws:
java.io.IOException

append

public void append(double value,
                   long timestamp,
                   byte flag)
            throws java.io.IOException
Throws:
java.io.IOException

getTimestampForLatestValue

public long getTimestampForLatestValue()

read

public Value read(long timestamp)
           throws java.io.IOException
Throws:
java.io.IOException

read

public java.util.List<Value> read(long start,
                                  long end)
                           throws java.io.IOException
Returns a List of Value Objects containing the measured Values between provided start and end timestamp

Parameters:
start -
end -
Throws:
java.io.IOException

readFully

public java.util.List<Value> readFully()
                                throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes and Flushes underlying Input- and OutputStreams

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes the underlying Data Streams.

Throws:
java.io.IOException