|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lmax.api.FixedPointNumber
public final class FixedPointNumber
FixedPointNumber class for use with the LMAX API.
Field Summary | |
---|---|
static FixedPointNumber |
ONE
|
static FixedPointNumber |
TEN
|
static FixedPointNumber |
ZERO
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Equality is based solely on the long value for this number. |
void |
format(java.lang.StringBuilder buffer,
int scale)
Populate the supplied StringBuilder with the value of this FixedPointNumber, appending trailing zeros up to the specified scale. |
int |
hashCode()
Hashcode is based solely on the long value for this number. |
long |
longValue()
Convert this FixedPointNumber to a long value that represents a decimal number with 6 decimal places. |
FixedPointNumber |
negate()
Negate this FixedPointNumber. |
long |
signum()
Returns the signum function of this FixedPointNumber . |
java.lang.String |
toString()
Convert this FixedPointNumber to a String removing trailing zeros. |
void |
toStringBuilder(java.lang.StringBuilder buffer)
Populate the supplied CharSequence with the value of this FixedPointNumber. |
static FixedPointNumber |
valueOf(char[] content,
int offset,
int count)
Create a new FixedPointNumber based on a string representation of a number within a char[], e.g. |
static FixedPointNumber |
valueOf(java.lang.CharSequence value)
Create a new FixedPointNumber based on a string representation of a number, e.g. |
static FixedPointNumber |
valueOf(long value)
Create a new FixedPointNumber based on a long value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final FixedPointNumber ZERO
public static final FixedPointNumber ONE
public static final FixedPointNumber TEN
Method Detail |
---|
public static FixedPointNumber valueOf(long value)
value
- The value to be represented as a FixedPointNumber.
public static FixedPointNumber valueOf(java.lang.CharSequence value)
value
- The value to be converted into a FixedPointNumber.
public static FixedPointNumber valueOf(char[] content, int offset, int count)
content
- The char[] containing the value to be converted into a FixedPointNumber.offset
- The offset into content containing the start of the number.count
- The number of chars in content to use.
public long signum()
FixedPointNumber
.
FixedPointNumber
is negative, zero, or positive.public FixedPointNumber negate()
public java.lang.String toString()
toString
in class java.lang.Object
public void toStringBuilder(java.lang.StringBuilder buffer)
buffer
- a CharSequence to be populated with the value of this FixedPointNumberpublic void format(java.lang.StringBuilder buffer, int scale)
buffer
- the StringBuilder to append the result toscale
- the scale to ensure the result is formatted topublic long longValue()
1
actually
represents a value of 0.000001
.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |