java.lang.Object
org.praxislive.core.Value
org.praxislive.core.types.PNumber
- All Implemented Interfaces:
Comparable<PNumber>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.praxislive.core.Value
Value.Type<T extends Value> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintbooleanValues must override the default equals method.booleanequivalent(Value arg) Indicates whether some other Value is equivalent to this one.inthashCode()Values must override the default hashcode method.static ArgumentInfoinfo()static ArgumentInfoinfo(double min, double max) static ArgumentInfoinfo(double min, double max, double skew) static ArgumentInfostatic ArgumentInfointegerInfo(int min, int max) booleanisEmpty()Check whether this Value is an empty value and has a zero length string representation.booleanstatic PNumberof(double val) static PNumberof(int val) static PNumberinttoString()Values must override the default method to return a string representation that is immutable.doublevalue()
-
Field Details
-
TYPE_NAME
Value type name.- See Also:
-
ONE
-
ZERO
-
KEY_MINIMUM
- See Also:
-
KEY_MAXIMUM
- See Also:
-
KEY_IS_INTEGER
- See Also:
-
KEY_SKEW
- See Also:
-
MAX_VALUE
public static final int MAX_VALUE- See Also:
-
MIN_VALUE
public static final int MIN_VALUE- See Also:
-
-
Method Details
-
value
public double value() -
toIntValue
public int toIntValue() -
toString
Description copied from class:ValueValues must override the default method to return a string representation that is immutable. -
hashCode
public int hashCode()Description copied from class:ValueValues must override the default hashcode method. -
equals
Description copied from class:ValueValues must override the default equals method. This method should only returntrueif the supplied Object is of the same type as the implementing Value. Values of an unknown type should be coerced before calling this method. This method does not have to guarantee thatthis.equals(that) == this.toString().equals(that.toString()) -
equivalent
Description copied from class:ValueIndicates whether some other Value is equivalent to this one. UnlikeValue.equals(java.lang.Object)this method is not symmetric - a value of a different type might be equivalent to this without the other type considering the reverse to be true.The default implementation uses identity or String equality.
- Overrides:
equivalentin classValue- Parameters:
arg- value to test for equivalence- Returns:
- true if value is equivalent to this
-
isEmpty
public boolean isEmpty()Description copied from class:ValueCheck whether this Value is an empty value and has a zero length string representation. Subclasses may wish to override this for efficiency if the String representation is lazily created. -
compareTo
- Specified by:
compareToin interfaceComparable<PNumber>
-
isInteger
public boolean isInteger() -
of
-
of
-
parse
- Throws:
ValueFormatException
-
from
-
info
-
info
-
info
-
integerInfo
-
integerInfo
-