public class DiscreteValue extends OOMDPValue implements Value
Modifier and Type | Field and Description |
---|---|
protected int |
discVal
The discrete value stored as an integer.
|
static int |
UNSET |
attribute
Constructor and Description |
---|
DiscreteValue(Attribute attribute)
Initializes this value to be an assignment for Attribute attribute.
|
DiscreteValue(Attribute attribute,
int discVal) |
DiscreteValue(DiscreteValue v)
Initializes this value as a copy from the source Value object v.
|
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuilder |
buildStringVal(java.lang.StringBuilder builder) |
Value |
copy()
Creates a deep copy of this value object.
|
boolean |
equals(java.lang.Object obj) |
boolean |
getBooleanValue()
Returns the boolean value of this attibute.
|
int |
getDiscVal()
Returns the discrete integer value of this Value object
|
double |
getNumericRepresentation()
Returns a numeric representation
|
Value |
setValue(boolean v)
Sets the internalvalue representation using a boolean value
|
Value |
setValue(double v)
Sets the internal value representation using a double value
|
Value |
setValue(int v)
Sets the internal value representation using an int value
|
Value |
setValue(java.lang.String v)
Sets the internal value representation using a string value
|
boolean |
valueHasBeenSet()
Returns whether the value has been set to a meaningful value.
|
addAllRelationalTargets, addRelationalTarget, attName, clearRelationTargets, getAllRelationalTargets, getAttribute, getDoubleArray, getIntArray, getRealVal, getStringVal, removeRelationalTarget, setValue, setValue, toString
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAllRelationalTargets, addRelationalTarget, attName, clearRelationTargets, getAllRelationalTargets, getAttribute, getDoubleArray, getIntArray, getRealVal, getStringVal, removeRelationalTarget, setValue, setValue
public static final int UNSET
protected final int discVal
public DiscreteValue(Attribute attribute)
attribute
- public DiscreteValue(DiscreteValue v)
v
- the source Value to make this object a copy of.public DiscreteValue(Attribute attribute, int discVal)
public boolean valueHasBeenSet()
Value
valueHasBeenSet
in interface Value
public Value copy()
Value
public Value setValue(int v)
OOMDPValue
setValue
in interface Value
setValue
in class OOMDPValue
v
- the int value assignmentpublic Value setValue(double v)
OOMDPValue
setValue
in interface Value
setValue
in class OOMDPValue
v
- the double value assignmentpublic Value setValue(boolean v)
OOMDPValue
setValue
in interface Value
setValue
in class OOMDPValue
v
- the boolean valuepublic Value setValue(java.lang.String v)
OOMDPValue
setValue
in interface Value
setValue
in class OOMDPValue
v
- the string value assignmentpublic int getDiscVal()
OOMDPValue
getDiscVal
in interface Value
getDiscVal
in class OOMDPValue
public java.lang.StringBuilder buildStringVal(java.lang.StringBuilder builder)
buildStringVal
in interface Value
public double getNumericRepresentation()
OOMDPValue
getNumericRepresentation
in interface Value
getNumericRepresentation
in class OOMDPValue
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean getBooleanValue()
OOMDPValue
getBooleanValue
in interface Value
getBooleanValue
in class OOMDPValue