|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.robokind.api.common.position.NormalizedDouble
public class NormalizedDouble
NormalizedDouble is a value normalized to the range of [0.0, 1.0] (0.0 <= val <= 1.0). The value is stored as a Double. When creating a NormalizedDouble, the value is checked to ensure it is within the range of [0.0, 1.0] and throws an IllegalArgumentException if invalid.
| Constructor Summary | |
|---|---|
NormalizedDouble(double value)
Creates a new NormalizedDouble with the given value |
|
| Method Summary | |
|---|---|
Object |
clone()
|
int |
compareTo(Object o)
|
boolean |
equals(Object obj)
|
double |
getValue()
Returns the value of the NormalizeRange. |
int |
hashCode()
|
static boolean |
isValid(double value)
Returns true if the given value can be used to create a NormalizedDouble. |
protected void |
rangeCheck(double value)
Checks that the value is within the range [0.0, 1.0]. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NormalizedDouble(double value)
value - the value to set
IllegalArgumentException - if value is not in the range [0.0, 1.0]| Method Detail |
|---|
public double getValue()
protected final void rangeCheck(double value)
value - the value to check
IllegalArgumentException - if value is not in the range [0.0,1.0]public static boolean isValid(double value)
value - the value to test
public int compareTo(Object o)
compareTo in interface Comparablepublic Object clone()
clone in class Objectpublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||