util
Class UncertainValue

java.lang.Object
  |
  +--util.Value
        |
        +--util.UncertainValue
Direct Known Subclasses:
DeviceState

public class UncertainValue
extends Value

This class can be used to encapsulate a response that you are not sure of. I created it thinking of device control -- when you ask for the status of a device, some controllers are more sure of their answers than others and I thought it would be good to include this certainty with the actual response.

See Also:
Serializable, Serialized Form

Field Summary
static int ALMOST_CERTAIN
           
static int ASSUMED
           
static int CERTAIN
           
protected  int confidence
           
static int GUESS
           
static int UNKNOWN
           
 
Fields inherited from class util.Value
value
 
Constructor Summary
UncertainValue()
           
UncertainValue(boolean value, int confidence)
           
UncertainValue(int value, int confidence)
           
UncertainValue(Object value, int confidence)
           
 
Method Summary
 int getConfidence()
           
 void setConfidence(int c)
           
 String toString()
           
 
Methods inherited from class util.Value
clone, equals, equals, equals, equals, getBooleanValue, getIntValue, getStringValue, getValue, setValue, setValue, setValue, valueEquals, valueModified
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CERTAIN

public static final int CERTAIN

ALMOST_CERTAIN

public static final int ALMOST_CERTAIN

ASSUMED

public static final int ASSUMED

GUESS

public static final int GUESS

UNKNOWN

public static final int UNKNOWN

confidence

protected int confidence
Constructor Detail

UncertainValue

public UncertainValue()

UncertainValue

public UncertainValue(Object value,
                      int confidence)

UncertainValue

public UncertainValue(boolean value,
                      int confidence)

UncertainValue

public UncertainValue(int value,
                      int confidence)
Method Detail

getConfidence

public int getConfidence()

setConfidence

public void setConfidence(int c)

toString

public String toString()
Overrides:
toString in class Value