|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnars.entity.ShortFloat
public class ShortFloat
A float value in [0, 1], with 4 digits accuracy.
Field Summary | |
---|---|
private short |
value
To save space, the values are stored as short integers (-32768 to 32767, only 0 to 10000 used), but used as float |
Constructor Summary | |
---|---|
ShortFloat(float v)
Constructor |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object that)
Compare two ShortFloat values |
(package private) short |
getShortValue()
To access the value as short |
float |
getValue()
To access the value as float |
int |
hashCode()
The hash code of the ShortFloat |
void |
setValue(float v)
Set new value, rounded, with validity checking |
java.lang.String |
toString()
Convert the value into a String |
java.lang.String |
toString2()
Round the value into a short String |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private short value
Constructor Detail |
---|
public ShortFloat(float v)
v
- The initial valueMethod Detail |
---|
public float getValue()
short getShortValue()
public void setValue(float v)
v
- The new valuepublic boolean equals(java.lang.Object that)
equals
in class java.lang.Object
that
- The other value to be compared
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString2()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |