saaps.dbt
Class OMNIDB

java.lang.Object
  |
  +--saaps.dbt.Database
        |
        +--saaps.dbt.OMNIDB

public class OMNIDB
extends Database

OMNIDB extends the Database class. It contains the read and write methods that are used in Database. The field is a vector of OMNI objects.

Version:
1.0 2000-04-14
Author:
Peter Wintoft
See Also:
OMNI

Field Summary
private static java.lang.String cName
           
private static boolean ct
           
private  OMNI data
           
private static double dataGapValueDefinition
           
private static double[] dataGapValues
           
private static java.lang.String description
           
private static java.util.Calendar et
           
private static java.lang.String[] fieldNames
           
private static java.lang.String[] fieldTypes
           
private static java.lang.String[] fieldUnits
           
private static java.lang.String longDescription
           
private static java.lang.String name
           
private static int numOfFields
           
private static java.util.Calendar st
           
private static long step
           
private  java.util.Vector vec
           
 
Fields inherited from class saaps.dbt.Database
baseDir, dataDirVar, dataGapValue, isSet, meta, raf
 
Constructor Summary
OMNIDB()
           
OMNIDB(int i)
           
OMNIDB(java.util.Vector VEC)
          When a new class is added to the database this constructor should be used which includes the information that goes into the meta data file.
 
Method Summary
 java.util.Date getDate(java.lang.Object obj)
          Gets the date from this object.
protected  MetaData getEmptyMetaData(java.util.Date sd, java.util.Date ed)
          Returns an "empty" metadata object.
 java.util.Vector getLatestDatabaseObjects()
          This method is implemented for Database abstract metod.
 void myHello()
           
 java.lang.Object read()
          Gets the object at the current point in file.
protected  MetaData setDefaultMeta(java.util.Date sd, java.util.Date ed)
          Creates a metadata file for this class with the default values set to the static values defined above.
 void write(java.lang.Object obj)
          Writes data at the current point in file.
 
Methods inherited from class saaps.dbt.Database
average, average, close, getDataGapValue, getFirst, getInstance, getInstance, getLast, getResampledTimeSeries, getTimeSeries, importAscii, isSet, position, position, position, retrieve, retrieve, retrieve, retrieve, retrieveAVE, retrieveAVE, retrieveOTS, retrieveSEA, retrieveTS, retrieveTS, store, store
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cName

private static java.lang.String cName

dataGapValueDefinition

private static final double dataGapValueDefinition

dataGapValues

private static double[] dataGapValues

name

private static java.lang.String name

description

private static java.lang.String description

longDescription

private static java.lang.String longDescription

st

private static java.util.Calendar st

et

private static java.util.Calendar et

ct

private static boolean ct

step

private static long step

fieldNames

private static java.lang.String[] fieldNames

fieldUnits

private static java.lang.String[] fieldUnits

fieldTypes

private static java.lang.String[] fieldTypes

numOfFields

private static int numOfFields

data

private OMNI data

vec

private java.util.Vector vec
Constructor Detail

OMNIDB

public OMNIDB()

OMNIDB

public OMNIDB(int i)

OMNIDB

public OMNIDB(java.util.Vector VEC)
       throws java.io.IOException
When a new class is added to the database this constructor should be used which includes the information that goes into the meta data file. The arguments are: Vector of OMNI objects, the class name, a short description, continuos time series (false/true), and if a continous time series the time step.
Method Detail

read

public java.lang.Object read()
                      throws java.io.IOException
Description copied from class: Database
Gets the object at the current point in file.
Overrides:
read in class Database
Following copied from class: saaps.dbt.Database
Returns:
an object from the database
Throws:
java.io.IOException - when reading fails

myHello

public void myHello()

write

public void write(java.lang.Object obj)
           throws java.io.IOException
Description copied from class: Database
Writes data at the current point in file.
Overrides:
write in class Database
Following copied from class: saaps.dbt.Database
Parameters:
dbo - an object containg data to be written.
Throws:
java.io.IOException - when writeing fails

getDate

public java.util.Date getDate(java.lang.Object obj)
Description copied from class: Database
Gets the date from this object. See also DatabaseObject.getDate().
Overrides:
getDate in class Database
Following copied from class: saaps.dbt.Database
Parameters:
obj - a database object
Returns:
the Date for the input object

getLatestDatabaseObjects

public java.util.Vector getLatestDatabaseObjects()
This method is implemented for Database abstract metod. It retrieves the latest data from the dataprovider and returns the vector of Database objects.
Overrides:
getLatestDatabaseObjects in class Database

setDefaultMeta

protected MetaData setDefaultMeta(java.util.Date sd,
                                  java.util.Date ed)
                           throws java.io.IOException
Creates a metadata file for this class with the default values set to the static values defined above. OBS!, check calendar ....
Overrides:
setDefaultMeta in class Database
Following copied from class: saaps.dbt.Database
Parameters:
sd - start time of data in datafile
ed - end time of data in datafile
Returns:
the new MetaData object
Throws:
java.io.IOException - when save of MetaData fails

getEmptyMetaData

protected MetaData getEmptyMetaData(java.util.Date sd,
                                    java.util.Date ed)
Returns an "empty" metadata object. All fields but Start and end time has valid values (as set in the respective database class). The times will be set to that what is supplied. OBS! This is not stored in the MetaData file !!
Overrides:
getEmptyMetaData in class Database
Following copied from class: saaps.dbt.Database
Parameters:
sd - fake start date
ed - fake end date
Returns:
the fake MetaData object