public class Decimal extends DataObject implements Value, ByteEncodable, ByteDecodable, LocaleFormatted
Modifier and Type | Field and Description |
---|---|
static boolean |
defaultFormatNoThousandGrouping
This is the default value for the ThousandGrouping on newly
created Decimal values - it is false by default.
|
protected boolean |
isCurrency
Set this true to indicate that this Decimal value is a currency value.
|
int |
localeFormatOptionsToClear
These are LocaleFormat option bits to clear, overriding the default
options for the locale.
|
int |
localeFormatOptionsToSet
These are LocaleFormat option bits to set, overriding the default
options for the locale.
|
String |
outputFormat |
Constructor and Description |
---|
Decimal() |
Decimal(BigDecimal bd) |
Decimal(BigDecimal jbd) |
Decimal(double value) |
Decimal(String str) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object other)
Compare this object with another.
|
void |
copyFrom(Object other)
Copy all appropriate data from another object.
|
int |
decodeBytes(byte[] source,
int offset,
int length)
This requests the Object to decode itself from a stream of bytes.
|
byte[] |
encodeBytes() |
int |
encodeBytes(ByteArray dest)
This requests the Object to encode itself as a stream of bytes which is appended
to the destination ByteArray.
|
void |
format(LocaleFormat locale,
CharArray dest) |
void |
fromString(char[] src,
int offset,
int length) |
void |
fromString(String value) |
BigDecimal |
getBigDecimal() |
Object |
getCopy()
Return a copy of this object.
|
BigDecimal |
getJavaBigDecimal() |
boolean |
isCurrency()
Returns if this Decimal value is considered a currency value.
|
void |
parse(LocaleFormat locale,
char[] data,
int offset,
int length) |
void |
setBigDecimal(BigDecimal bd) |
Decimal |
setDouble(double value) |
void |
setJavaBigDecimal(BigDecimal jbd) |
String |
toString()
Return a String representation of this object.
|
CharArray |
toString(CharArray dest) |
_getFieldType, _getSetField, cache, copied, equals, getDeclaredField, getDeclaredFieldValue, getMyFieldList, getNew
protected boolean isCurrency
public String outputFormat
public static boolean defaultFormatNoThousandGrouping
public int localeFormatOptionsToSet
public int localeFormatOptionsToClear
public Decimal()
public Decimal(double value)
public Decimal(BigDecimal bd)
public Decimal(BigDecimal jbd)
public Decimal(String str)
public boolean isCurrency()
public Object getCopy()
Copyable
getCopy
in interface Copyable
getCopy
in class DataObject
public void copyFrom(Object other)
DataUnit
copyFrom
in interface DataUnit
copyFrom
in class DataObject
public int compareTo(Object other)
Comparable
compareTo
in interface Comparable
compareTo
in class DataObject
public String toString()
Object
toString
in interface Stringable
toString
in class Object
public void fromString(String value)
fromString
in interface Stringable
public BigDecimal getBigDecimal()
public BigDecimal getJavaBigDecimal()
public void setBigDecimal(BigDecimal bd)
public void setJavaBigDecimal(BigDecimal jbd)
public int encodeBytes(ByteArray dest)
ByteEncodable
encodeBytes
in interface ByteEncodable
dest
- The destination ByteArray, or null to determine the number of bytes needed to encode.public byte[] encodeBytes()
encodeBytes
in interface ByteEncodable
public int decodeBytes(byte[] source, int offset, int length)
ByteDecodable
decodeBytes
in interface ByteDecodable
source
- The source of the encoded bytes.offset
- Where the object should start decoding from.length
- The number of bytes left starting from startOffsetInSource.public Decimal setDouble(double value)
public CharArray toString(CharArray dest)
toString
in interface Stringable
public void fromString(char[] src, int offset, int length)
fromString
in interface Stringable
public void format(LocaleFormat locale, CharArray dest)
format
in interface LocaleFormatted
public void parse(LocaleFormat locale, char[] data, int offset, int length) throws ParseException
parse
in interface LocaleFormatted
ParseException