com.yosokumo.core
Class NaturalValue
java.lang.Object
com.yosokumo.core.Value
com.yosokumo.core.NaturalValue
public class NaturalValue
- extends Value
Represents an unsigned integer value. Since Java does not support
unsigned, the value is stored in a long. All 64 bits of the unsigned
value are stored, but no arithmetic operations are allowed on the value.
Tests for equality and inequality are allowed, but not tests for greater
than or less than.
Nested classes/interfaces inherited from class com.yosokumo.core.Value |
Value.Type |
Constructor Summary |
NaturalValue(long value)
Initialize a newly created NaturalValue object with the
value specified by the input parameter. |
Method Summary |
Value.Type |
getType()
Return the natural type. |
long |
getValue()
Return the natural value stored in this object. |
java.lang.String |
toString()
Return the natural value as a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
naturalValue
private long naturalValue
NaturalValue
public NaturalValue(long value)
- Initialize a newly created
NaturalValue
object with the
value specified by the input parameter.
- Parameters:
value
- is the natural value (>= 0).
getType
public Value.Type getType()
- Return the natural type.
- Specified by:
getType
in class Value
- Returns:
- the natural type: Type.NATURAL.
getValue
public long getValue()
- Return the natural value stored in this object.
- Returns:
- the natural value.
toString
public java.lang.String toString()
- Return the natural value as a String.
- Specified by:
toString
in class Value
- Returns:
- the natural value as a String.