agentland.device
Class DeviceState

java.lang.Object
  |
  +--util.Value
        |
        +--util.UncertainValue
              |
              +--agentland.device.DeviceState
All Implemented Interfaces:
Cloneable, Serializable

public class DeviceState
extends UncertainValue

Base class for describing state of any device.

See Also:
UncertainValue, Serialized Form

Field Summary
protected  long modifyTime
           
protected  String name
           
 
Fields inherited from class util.UncertainValue
ALMOST_CERTAIN, ASSUMED, CERTAIN, confidence, GUESS, UNKNOWN
 
Fields inherited from class util.Value
value
 
Constructor Summary
DeviceState()
           
DeviceState(boolean value, int confidence)
           
DeviceState(int value, int confidence)
           
DeviceState(Object value, int confidence)
           
DeviceState(String name)
           
DeviceState(String name, boolean value, int confidence)
           
DeviceState(String name, int value, int confidence)
           
DeviceState(String name, Object value, int confidence)
           
 
Method Summary
 long age()
          returns the number of miliseconds since the last time the state was modified
 boolean equals(Object o)
          Does equal only on the value object -- perhaps this is not correct but you will be able to treat this almost as if you were dealing with the value itself when you are dealing with this proxy object
 long getModifyTime()
          Returns the time when the value was last modified.
 String getName()
           
 void reset()
          Resets the state to some default value
protected  void resetModifyTime()
           
 void setName(String v)
          Set the name of this state description
 String toString()
           
protected  void valueModified()
          This method is in here in case any of the children of this class ever tried to be a bean or something and needed to perform some action when value gets modified.
 
Methods inherited from class util.UncertainValue
getConfidence, setConfidence
 
Methods inherited from class util.Value
clone, equals, equals, equals, getBooleanValue, getFloatValue, getIntValue, getStringValue, getValue, setValue, setValue, setValue, setValue, valueEquals
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name

modifyTime

protected long modifyTime
Constructor Detail

DeviceState

public DeviceState()

DeviceState

public DeviceState(String name)

DeviceState

public DeviceState(Object value,
                   int confidence)

DeviceState

public DeviceState(String name,
                   Object value,
                   int confidence)

DeviceState

public DeviceState(boolean value,
                   int confidence)

DeviceState

public DeviceState(String name,
                   boolean value,
                   int confidence)

DeviceState

public DeviceState(int value,
                   int confidence)

DeviceState

public DeviceState(String name,
                   int value,
                   int confidence)
Method Detail

getModifyTime

public long getModifyTime()
Returns the time when the value was last modified.
Returns:
a long value

age

public long age()
returns the number of miliseconds since the last time the state was modified

getName

public String getName()

setName

public void setName(String v)
Set the name of this state description

reset

public void reset()
Resets the state to some default value

valueModified

protected void valueModified()
Description copied from class: Value
This method is in here in case any of the children of this class ever tried to be a bean or something and needed to perform some action when value gets modified. Here this method does nothing.
Overrides:
valueModified in class Value

resetModifyTime

protected void resetModifyTime()

equals

public boolean equals(Object o)
Description copied from class: Value
Does equal only on the value object -- perhaps this is not correct but you will be able to treat this almost as if you were dealing with the value itself when you are dealing with this proxy object
Overrides:
equals in class Value
Following copied from class: util.Value
Parameters:
o - an Object value
Returns:
a boolean value

toString

public String toString()
Overrides:
toString in class UncertainValue