saaps.dbt
Class ACEmagHourlyDB

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

public class ACEmagHourlyDB
extends Database

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

Version:
1.0 2000-09-04
Author:
Peter Wintoft
See Also:
ACEmagHourly

Field Summary
private  ACEmagHourly ace
           
private  java.util.Vector acev
           
private static java.lang.String className
           
private static boolean ct
           
private  double dataGapValueDefinition
           
private static java.lang.String dbName
           
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.util.Calendar st
           
private static long step
           
 
Fields inherited from class saaps.dbt.Database
baseDir, dataDirVar, dataGapValue, isSet, meta, raf
 
Constructor Summary
ACEmagHourlyDB()
           
ACEmagHourlyDB(int i)
           
ACEmagHourlyDB(java.util.Vector ACEV)
          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.
protected  void importAscii1(java.lang.String inputfile)
          This method is used for importing ASCII data to our database.
 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

dataGapValueDefinition

private double dataGapValueDefinition

className

private static java.lang.String className

dbName

private static java.lang.String dbName

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

ace

private ACEmagHourly ace

acev

private java.util.Vector acev
Constructor Detail

ACEmagHourlyDB

public ACEmagHourlyDB()

ACEmagHourlyDB

public ACEmagHourlyDB(int i)

ACEmagHourlyDB

public ACEmagHourlyDB(java.util.Vector ACEV)
               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 ACE 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 retreives the latest data from the dataprovider and returns the vector of Database objects.
Overrides:
getLatestDatabaseObjects in class Database

importAscii1

protected void importAscii1(java.lang.String inputfile)
This method is used for importing ASCII data to our database. The format of the data is as output from ExportAscii application. It will fill a buffer of databaseobjects and then try to store it, read again and store until it is finished or an exception occures.

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