com.isti.trinetwatch.params
Class ParamHistoryVector

java.lang.Object
  extended by com.isti.trinetwatch.params.ParamHistoryVector
All Implemented Interfaces:
ParamHistory

public class ParamHistoryVector
extends java.lang.Object
implements ParamHistory

Class ParamHistoryVector defines the history vector for station parameters.


Constructor Summary
ParamHistoryVector()
          Constructs a history vector.
 
Method Summary
 void add(DynamicParamHolder paramHolder, Station stationObj, DynamicParameter dParameter, long timeLastChanged, long timeLastReceived, long minTime)
          Adds the item to the history.
 void closeHistory()
          Closes this history, releasing resources allocated for it.
 java.util.Vector getHistoryVector(long startTime, long endTime)
          Returns a new Vector containing 'ValueTimeBlock' objects with timestamps in the specified range.
 ValueTimeBlock getNewestHistoryItem()
          Returns the newest item in the history.
 boolean isHistoryEnabled()
          Determines if the history is enabled.
 ArchivableData setupArchiveManager(DynamicParamHolder paramHolder, Station stationObj, DynamicParameter dParameter, long timeLastReceived)
          Sets up the archive manager for this table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamHistoryVector

public ParamHistoryVector()
Constructs a history vector.

Method Detail

add

public void add(DynamicParamHolder paramHolder,
                Station stationObj,
                DynamicParameter dParameter,
                long timeLastChanged,
                long timeLastReceived,
                long minTime)
Adds the item to the history.

Specified by:
add in interface ParamHistory
Parameters:
paramHolder - the parameter holder.
stationObj - the station object.
dParameter - the dynamic parameter.
timeLastChanged - the time last changed (seconds since 1/1/1970).
timeLastReceived - the time last received (seconds since 1/1/1970).
minTime - the minimum time (seconds since 1/1/1970).

setupArchiveManager

public ArchivableData setupArchiveManager(DynamicParamHolder paramHolder,
                                          Station stationObj,
                                          DynamicParameter dParameter,
                                          long timeLastReceived)
Sets up the archive manager for this table. Not implemented for this class.

Specified by:
setupArchiveManager in interface ParamHistory
Parameters:
paramHolder - the parameter holder.
stationObj - the station object.
dParameter - the dynamic parameter.
timeLastReceived - the time last received (seconds since 1/1/1970).
Returns:
An 'ArchivableData' object created via the given parameter value, or null if an error occurred.

getHistoryVector

public java.util.Vector getHistoryVector(long startTime,
                                         long endTime)
Returns a new Vector containing 'ValueTimeBlock' objects with timestamps in the specified range. The start and end time parameter values are in seconds since 1/1/1970, and are "inclusive".

Specified by:
getHistoryVector in interface ParamHistory
Parameters:
startTime - the start time for the range, or 0 for the beginning of the history.
endTime - the end time for the range, or 0 for the end of the history.
Returns:
A Vector of 'ValueTimeBlock' objects with timestamps in the specified range, or an empty Vector if no matching objects were found.

getNewestHistoryItem

public ValueTimeBlock getNewestHistoryItem()
Returns the newest item in the history.

Specified by:
getNewestHistoryItem in interface ParamHistory
Returns:
A 'ValueTimeBlock' object representing the newest item in the history, or null if no history objects are available.

isHistoryEnabled

public boolean isHistoryEnabled()
Determines if the history is enabled.

Specified by:
isHistoryEnabled in interface ParamHistory
Returns:
true if enabled, false otherwise.

closeHistory

public void closeHistory()
Closes this history, releasing resources allocated for it.

Specified by:
closeHistory in interface ParamHistory