gov.sandia.cognition.util
Class DefaultTemporalValue<ValueType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.util.AbstractTemporal
          extended by gov.sandia.cognition.util.DefaultTemporalValue<ValueType>
Type Parameters:
ValueType - The value type.
All Implemented Interfaces:
CloneableSerializable, Pair<Date,ValueType>, Temporal, TemporalValue<ValueType>, Serializable, Cloneable, Comparable<Temporal>

public class DefaultTemporalValue<ValueType>
extends AbstractTemporal
implements TemporalValue<ValueType>, Pair<Date,ValueType>

The DefaultTemporalValue class is a default implementation of the TemporalValue interface. It has fields for the time and the value.

Since:
2.1
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  ValueType value
          The value associated with the time.
 
Fields inherited from class gov.sandia.cognition.util.AbstractTemporal
time
 
Constructor Summary
DefaultTemporalValue()
          Creates a new, empty DefaultTemporalValue.
DefaultTemporalValue(Date time, ValueType value)
          Creates a new DefaultTemporalValue.
 
Method Summary
 Date getFirst()
          Gets the first value of the pair, which is the time.
 ValueType getSecond()
          Gets the second value fo the pair, which is the value.
 ValueType getValue()
          Gets the value stored in this object.
 void setValue(ValueType value)
          Sets the value.
 
Methods inherited from class gov.sandia.cognition.util.AbstractTemporal
clone, compareTo, getTime, setTime
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.Temporal
getTime
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

value

protected ValueType value
The value associated with the time.

Constructor Detail

DefaultTemporalValue

public DefaultTemporalValue()
Creates a new, empty DefaultTemporalValue.


DefaultTemporalValue

public DefaultTemporalValue(Date time,
                            ValueType value)
Creates a new DefaultTemporalValue.

Parameters:
time - The time associated with the value.
value - The value associated with the time.
Method Detail

getValue

public ValueType getValue()
Description copied from interface: TemporalValue
Gets the value stored in this object.

Specified by:
getValue in interface TemporalValue<ValueType>
Returns:
The value.

setValue

public void setValue(ValueType value)
Sets the value.

Parameters:
value - The new value.

getFirst

public Date getFirst()
Gets the first value of the pair, which is the time.

Specified by:
getFirst in interface Pair<Date,ValueType>
Returns:
The time.

getSecond

public ValueType getSecond()
Gets the second value fo the pair, which is the value.

Specified by:
getSecond in interface Pair<Date,ValueType>
Returns:
The value.