util
Class Value
java.lang.Object
|
+--util.Value
- Direct Known Subclasses:
- Need, UncertainValue
- public class Value
- extends Object
- implements Serializable, Cloneable
This class is useful if you deal with a situation where you are
likely to be dealing with objects or primitives. It's equals method
does equals only on the actual contained value and it is overloaded
to deal with all supported primitive types.
- See Also:
Serializable
, Serialized Form
value
protected Object value
Value
public Value()
Value
public Value(Object value)
Value
public Value(boolean value)
Value
public Value(int value)
Value
public Value(float value)
getValue
public Object getValue()
getStringValue
public String getStringValue()
- Returns whatever value it has cast to string
getBooleanValue
public boolean getBooleanValue()
getIntValue
public int getIntValue()
setValue
public void setValue(Object o)
setValue
public void setValue(int v)
setValue
public void setValue(boolean v)
valueModified
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. Here this method
does nothing.
equals
public 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
- Overrides:
- equals in class Object
- Parameters:
o
- an Object
value- Returns:
- a
boolean
value
valueEquals
public boolean valueEquals(Object o)
equals
public boolean equals(int i)
equals
public boolean equals(float f)
equals
public boolean equals(boolean b)
clone
public Object clone()
- Overrides:
- clone in class Object
toString
public String toString()
- Overrides:
- toString in class Object