com.isti.util
Class ValueTimeBlock

java.lang.Object
  extended bycom.isti.util.ValueTimeUtilFns
      extended bycom.isti.util.ValueTimeBlock
All Implemented Interfaces:
Archivable
Direct Known Subclasses:
ArchivableData

public class ValueTimeBlock
extends ValueTimeUtilFns
implements Archivable

Class ValueTimeBlock defines a data block containing a parameter value object and a timestamp value. If the class for the data has a constructor with a String parameter then the de-archived data should be identical to the original data, otherwise the de-archived data will contain a string representation of the original data.


Nested Class Summary
 
Nested classes inherited from class com.isti.util.Archivable
Archivable.Marker
 
Field Summary
 java.lang.Object data
          The data object (Double, String, etc.)
 long timestamp
          The timestamp value (seconds since January 1, 1970, 00:00:00 GMT.)
 
Fields inherited from class com.isti.util.ValueTimeUtilFns
constructorParameterTypes, DATA_SEPARATOR, gmtFlag
 
Constructor Summary
ValueTimeBlock(java.lang.Object data, long timestamp)
          Constructor which initializes values.
ValueTimeBlock(java.lang.String dataStr)
          Constructor which initializes values.
ValueTimeBlock(java.lang.String dataStr, Archivable.Marker mkrObj)
          Constructor which initializes values.
ValueTimeBlock(ValueTimeBlock vtb)
          Constructor which initializes values.
 
Method Summary
 boolean dataEquals(java.lang.Object data)
          Indicates whether some other data is equal to this object's data.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is equal to this one.
 boolean equals(ValueTimeBlock obj)
          Indicates whether some other object is equal to this one.
 java.util.Date getArchiveDate()
          Returns a 'Date' object representing the date to be used for archival purposes.
 long getArchiveTime()
          Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT representing the date to be used for archival purposes.
 java.lang.String getTimestampText()
          Returns a string representation of the timestamp.
 int hashCode()
          Returns a hash code value for the object.
 boolean timestampEquals(long timestamp)
          Indicates whether some other timestamp is equal to this object's timestamp.
 java.lang.String toArchivedForm()
          Returns the archivable representation for this object.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class com.isti.util.ValueTimeUtilFns
getComponentForClass, getConstructorForClass, getCurrentTime, getCurrentTimestamp, getTime, getTimestamp, getTimestampText, getTimestampText, getTimeText, getTimeText, getValueTimeBlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

data

public java.lang.Object data
The data object (Double, String, etc.)


timestamp

public long timestamp
The timestamp value (seconds since January 1, 1970, 00:00:00 GMT.)

Constructor Detail

ValueTimeBlock

public ValueTimeBlock(java.lang.Object data,
                      long timestamp)
Constructor which initializes values.

Parameters:
data - data object, such as Integer, Double, String, etc.
timestamp - timestamp value for data (seconds since January 1, 1970, 00:00:00 GMT.)
See Also:
getCurrentTimestamp

ValueTimeBlock

public ValueTimeBlock(java.lang.String dataStr)
Constructor which initializes values.

Parameters:
dataStr - the archivable representation for this object.

ValueTimeBlock

public ValueTimeBlock(java.lang.String dataStr,
                      Archivable.Marker mkrObj)
Constructor which initializes values. This is part of the Archivable interface.

Parameters:
dataStr - the archivable representation for this object.
mkrObj - the marker object.

ValueTimeBlock

public ValueTimeBlock(ValueTimeBlock vtb)
Constructor which initializes values.

Parameters:
vtb - the value time block.
Method Detail

dataEquals

public boolean dataEquals(java.lang.Object data)
Indicates whether some other data is equal to this object's data.

Parameters:
data - the reference data with which to compare.
Returns:
true if this object's data is the same as the data argument; false otherwise.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is equal to this one.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

equals

public boolean equals(ValueTimeBlock obj)
Indicates whether some other object is equal to this one.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

getArchiveDate

public java.util.Date getArchiveDate()
Returns a 'Date' object representing the date to be used for archival purposes. This is part of the Archivable interface.

Specified by:
getArchiveDate in interface Archivable
Returns:
A 'Date' object representing the date that the item should be archived under.

getArchiveTime

public long getArchiveTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT representing the date to be used for archival purposes.

Returns:
the number of milliseconds since January 1, 1970, 00:00:00 GMT.

getTimestampText

public java.lang.String getTimestampText()
Returns a string representation of the timestamp.

Returns:
a string representation of the timestamp.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Returns:
a hash code value for this object.

timestampEquals

public boolean timestampEquals(long timestamp)
Indicates whether some other timestamp is equal to this object's timestamp.

Parameters:
timestamp - the reference timestamp with which to compare.
Returns:
true if this object's timestamp is the same as the timestamp argument; false otherwise.

toArchivedForm

public java.lang.String toArchivedForm()
Returns the archivable representation for this object. When the object is recreated from the string, it should be identical to the original. This is part of the Archivable interface.

Specified by:
toArchivedForm in interface Archivable
Returns:
A String representing the archived form of the object.

toString

public java.lang.String toString()
Returns a string representation of the object.

Returns:
a string representation of the object.