public class ReadOnlyDecimalFloat extends java.lang.Object implements java.lang.Comparable<ReadOnlyDecimalFloat>
DecimalFloat.immutableCopy()| Modifier and Type | Field and Description |
|---|---|
static ReadOnlyDecimalFloat |
MAX_VALUE |
static ReadOnlyDecimalFloat |
MIN_VALUE |
static ReadOnlyDecimalFloat |
MISSING_FLOAT |
static ReadOnlyDecimalFloat |
NAN |
protected int |
scale |
protected long |
value |
static ReadOnlyDecimalFloat |
ZERO |
| Modifier and Type | Method and Description |
|---|---|
void |
appendTo(java.lang.StringBuilder builder) |
int |
compareTo(ReadOnlyDecimalFloat other) |
boolean |
equals(java.lang.Object o)
This method should satisfy the Effective Java - 3rd Edition - Methods Common to All Objects Item 10
"Obey the general contract when overriding equals",
and it should do it for every x and y where x and y can be an instance of
ReadOnlyDecimalFloat or DecimalFloat, in any order, this method is:
Reflexive : x.equal(x) return true
Symmetric : if x.equals(y) return true, y.equals(x) return true
Transitive : if x.equals(y) return true and y.equals(z) return true, x.equals(z) return true
Consistent : invocations of x.equals(y) return the same value
For any x != null, x.equals(null) returns false
Support for DecimalFloat was done to provide a backward compatibility when some constants such as ZERO or NAN
were made read only to avoid subtle bugs.
|
int |
hashCode() |
boolean |
isNaNValue() |
static boolean |
isNaNValue(long value,
int scale) |
DecimalFloat |
mutableCopy() |
int |
scale()
Get the number of digits to the right of the decimal point.
|
protected void |
setAndNormalise(long value,
int scale) |
double |
toDouble() |
java.lang.String |
toString() |
long |
value() |
public static final ReadOnlyDecimalFloat MIN_VALUE
public static final ReadOnlyDecimalFloat MAX_VALUE
public static final ReadOnlyDecimalFloat ZERO
public static final ReadOnlyDecimalFloat NAN
public static final ReadOnlyDecimalFloat MISSING_FLOAT
protected long value
protected int scale
public DecimalFloat mutableCopy()
public boolean isNaNValue()
public double toDouble()
public static boolean isNaNValue(long value,
int scale)
public long value()
public int scale()
public void appendTo(java.lang.StringBuilder builder)
public java.lang.String toString()
toString in class java.lang.Objectpublic final int compareTo(ReadOnlyDecimalFloat other)
compareTo in interface java.lang.Comparable<ReadOnlyDecimalFloat>public final boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - object to compare withpublic final int hashCode()
hashCode in class java.lang.Objectprotected final void setAndNormalise(long value,
int scale)
Copyright © 2015-2022 Real Logic Limited. All Rights Reserved.