public class RMNumberFormat extends java.lang.Object implements RMFormat, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static RMNumberFormat |
BASIC |
static RMNumberFormat |
CURRENCY |
static RMNumberFormat |
DOLLARS |
static RMNumberFormat |
PLAIN |
Constructor and Description |
---|
RMNumberFormat()
Creates an uninitialized number format.
|
RMNumberFormat(java.lang.String aFormatString)
Creates a number format for the given format string.
|
Modifier and Type | Method and Description |
---|---|
RMNumberFormat |
clone()
Standard clone implementation.
|
boolean |
equals(java.lang.Object anObj)
Standard equals implementation.
|
java.lang.String |
format(java.lang.Object anObj)
Returns a formatted version of the given object.
|
TextStyle |
formatStyle(java.lang.Object anObj)
Returns the format style.
|
java.lang.Object |
fromXML(XMLArchiver anArchiver,
XMLElement anElement)
XML unarchival.
|
java.lang.String |
getDecimalSeparator()
Returns the decimal separator.
|
static java.util.Locale |
getDefaultLocale()
Returns the default locale.
|
java.lang.String |
getLocalCurrencySymbol()
Returns the Currency symbol used for this locale.
|
int |
getMaximumFractionDigits()
Returns maximum fraction digits.
|
int |
getMinimumFractionDigits()
Returns minimum fraction digits.
|
java.lang.String |
getNullString()
Returns the String that is substituted when this format is asked to provide stringForObjectValue(null).
|
java.lang.String |
getPattern()
Returns the format string for this format.
|
java.lang.String |
getThousandsSeparator()
Returns the thousands separator.
|
boolean |
isCurrencySymbolUsed()
Returns whether currency symbol is used (dollars, local or international).
|
boolean |
isGroupingUsed()
Returns whether grouping used.
|
boolean |
isLocalCurrencySymbolUsed()
Returns whether local currency symbol is used.
|
boolean |
isNegativeInRed()
Returns whether this format shows negative values in red.
|
boolean |
isPercentSymbolUsed()
Returns whether percent symbol is used.
|
java.lang.Number |
parse(java.lang.String aStr)
Tries to parse a number from given string using this format.
|
void |
setDecimalSeparator(java.lang.String aValue)
Sets the decimal separator.
|
static void |
setDefaultLocale(java.util.Locale aLocale)
Sets the default locale.
|
void |
setGroupingUsed(boolean aVal)
Sets minimum fraction digits.
|
void |
setLocalCurrencySymbolUsed(boolean aFlag)
Sets whether local currency symbol is used.
|
void |
setMaximumFractionDigits(int aVal)
Sets maximum fraction digits.
|
void |
setMinimumFractionDigits(int aVal)
Sets minimum fraction digits.
|
void |
setNegativeInRed(boolean aFlag)
Sets whether this format shows negative values in red.
|
void |
setNullString(java.lang.String aString)
Sets the String that is substituted when this format is asked to provide stringForObjectValue(null).
|
void |
setPattern(java.lang.String aFormat)
Sets the format string for this format.
|
void |
setPercentSymbolUsed(boolean aFlag)
Returns whether percent symbol is used.
|
void |
setThousandsSeparator(java.lang.String aValue)
Sets the thousands separator.
|
XMLElement |
toXML(XMLArchiver anArchiver)
XML archival.
|
public static RMNumberFormat PLAIN
public static RMNumberFormat BASIC
public static RMNumberFormat DOLLARS
public static RMNumberFormat CURRENCY
public RMNumberFormat()
public RMNumberFormat(java.lang.String aFormatString)
public java.lang.String getNullString()
public void setNullString(java.lang.String aString)
public boolean isNegativeInRed()
public void setNegativeInRed(boolean aFlag)
public java.lang.String getLocalCurrencySymbol()
public boolean isLocalCurrencySymbolUsed()
public void setLocalCurrencySymbolUsed(boolean aFlag)
public boolean isCurrencySymbolUsed()
public boolean isPercentSymbolUsed()
public void setPercentSymbolUsed(boolean aFlag)
public java.lang.String getThousandsSeparator()
public void setThousandsSeparator(java.lang.String aValue)
public java.lang.String getDecimalSeparator()
public void setDecimalSeparator(java.lang.String aValue)
public int getMinimumFractionDigits()
public void setMinimumFractionDigits(int aVal)
public int getMaximumFractionDigits()
public void setMaximumFractionDigits(int aVal)
public boolean isGroupingUsed()
public void setGroupingUsed(boolean aVal)
public java.lang.String getPattern()
public void setPattern(java.lang.String aFormat)
public java.lang.String format(java.lang.Object anObj)
public TextStyle formatStyle(java.lang.Object anObj)
public static java.util.Locale getDefaultLocale()
public static void setDefaultLocale(java.util.Locale aLocale)
public java.lang.Number parse(java.lang.String aStr)
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public RMNumberFormat clone()
clone
in class java.lang.Object
public XMLElement toXML(XMLArchiver anArchiver)
public java.lang.Object fromXML(XMLArchiver anArchiver, XMLElement anElement)