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, getNewprotected 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()
CopyablegetCopy in interface CopyablegetCopy in class DataObjectpublic void copyFrom(Object other)
DataUnitcopyFrom in interface DataUnitcopyFrom in class DataObjectpublic int compareTo(Object other)
ComparablecompareTo in interface ComparablecompareTo in class DataObjectpublic String toString()
ObjecttoString in interface StringabletoString in class Objectpublic void fromString(String value)
fromString in interface Stringablepublic BigDecimal getBigDecimal()
public BigDecimal getJavaBigDecimal()
public void setBigDecimal(BigDecimal bd)
public void setJavaBigDecimal(BigDecimal jbd)
public int encodeBytes(ByteArray dest)
ByteEncodableencodeBytes in interface ByteEncodabledest - The destination ByteArray, or null to determine the number of bytes needed to encode.public byte[] encodeBytes()
encodeBytes in interface ByteEncodablepublic int decodeBytes(byte[] source,
int offset,
int length)
ByteDecodabledecodeBytes in interface ByteDecodablesource - 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 Stringablepublic void fromString(char[] src,
int offset,
int length)
fromString in interface Stringablepublic void format(LocaleFormat locale, CharArray dest)
format in interface LocaleFormattedpublic void parse(LocaleFormat locale, char[] data, int offset, int length) throws ParseException
parse in interface LocaleFormattedParseException