|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--intradoc.common.IdcNumberFormat
| Field Summary | |
static int |
FRACTION_FIELD
|
static int |
INTEGER_FIELD
|
static int |
MAX_COUNT
The maximum number of significant digits in an IEEE 754 double, that is, in a Java double. |
| Constructor Summary | |
IdcNumberFormat()
Default constructor. |
|
IdcNumberFormat(char decimalSeparator,
char groupingSeparator,
char zero)
Create an IdcNumberFormat from the given symbols. |
|
| Method Summary | |
boolean |
equals(java.lang.Object obj)
Overrides equals |
java.lang.String |
format(double number)
|
java.lang.StringBuffer |
format(double number,
java.lang.StringBuffer result,
IdcPosition fieldPosition)
Formats a double to produce a string. |
java.lang.String |
format(long number)
|
java.lang.StringBuffer |
format(long number,
java.lang.StringBuffer result,
IdcPosition fieldPosition)
Format a long to produce a string. |
java.lang.StringBuffer |
format(java.lang.Object number,
java.lang.StringBuffer toAppendTo,
IdcPosition pos)
|
char |
getDecimalSeparator()
|
char |
getGroupingSeparator()
|
int |
getGroupingSize()
Return the grouping size. |
java.lang.String |
getInfinity()
|
int |
getMaximumFractionDigits()
Returns the maximum number of digits allowed in the fraction portion of a number. |
int |
getMaximumIntegerDigits()
Returns the maximum number of digits allowed in the integer portion of a number. |
int |
getMinimumFractionDigits()
Returns the minimum number of digits allowed in the fraction portion of a number. |
int |
getMinimumIntegerDigits()
Returns the minimum number of digits allowed in the integer portion of a number. |
int |
getMultiplier()
Get the multiplier for use in percent, permill, etc. |
java.lang.String |
getNaN()
|
java.lang.String |
getNegativePrefix()
Get the negative prefix. |
java.lang.String |
getNegativeSuffix()
Get the negative suffix. |
java.lang.String |
getPositivePrefix()
Get the positive prefix. |
java.lang.String |
getPositiveSuffix()
Get the positive suffix. |
char |
getZeroDigit()
|
int |
hashCode()
Overrides hashCode |
boolean |
isDecimalSeparatorAlwaysShown()
Allows you to get the behavior of the decimal separator with integers. |
boolean |
isGroupingUsed()
Returns true if grouping is used in this format. |
boolean |
isParseIntegerOnly()
Returns true if this format will parse numbers as integers only. |
java.lang.Number |
parse(java.lang.String text)
|
java.lang.Number |
parse(java.lang.String text,
ParseStringLocation parsePosition)
Returns an instance of Number with a value matching the
given string. |
void |
setDecimalSeparator(char c)
|
void |
setDecimalSeparatorAlwaysShown(boolean newValue)
Allows you to set the behavior of the decimal separator with integers. |
void |
setGroupingSeparator(char c)
|
void |
setGroupingSize(int newValue)
Set the grouping size. |
void |
setGroupingUsed(boolean newValue)
Set whether or not grouping will be used in this format. |
void |
setInfinity(java.lang.String s)
|
void |
setMaximumFractionDigits(int newValue)
Sets the maximum number of digits allowed in the fraction portion of a number. |
void |
setMaximumIntegerDigits(int newValue)
Sets the maximum number of digits allowed in the integer portion of a number. |
void |
setMinimumFractionDigits(int newValue)
Sets the minimum number of digits allowed in the fraction portion of a number. |
void |
setMinimumIntegerDigits(int newValue)
Sets the minimum number of digits allowed in the integer portion of a number. |
void |
setMultiplier(int newValue)
Set the multiplier for use in percent, permill, etc. |
void |
setNaN(java.lang.String s)
|
void |
setNegativePrefix(java.lang.String newValue)
Set the negative prefix. |
void |
setNegativeSuffix(java.lang.String newValue)
Set the positive suffix. |
void |
setParseIntegerOnly(boolean value)
Sets whether or not numbers should be parsed as integers only. |
void |
setPositivePrefix(java.lang.String newValue)
Set the positive prefix. |
void |
setPositiveSuffix(java.lang.String newValue)
Set the positive suffix. |
void |
setZeroDigit(char c)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int MAX_COUNT
public static final int INTEGER_FIELD
public static final int FRACTION_FIELD
| Constructor Detail |
public IdcNumberFormat()
public IdcNumberFormat(char decimalSeparator,
char groupingSeparator,
char zero)
java.lang.IllegalArgumentException - if the given pattern is invalidDecimalFormatSymbols| Method Detail |
public final java.lang.StringBuffer format(java.lang.Object number,
java.lang.StringBuffer toAppendTo,
IdcPosition pos)
public final java.lang.String format(double number)
public final java.lang.String format(long number)
public java.lang.StringBuffer format(double number,
java.lang.StringBuffer result,
IdcPosition fieldPosition)
number - The double to formatresult - Where the text result is appended to.fieldPosition - On input: an alignment field, if desired.
On output: the offsets of the alignment field.
public java.lang.StringBuffer format(long number,
java.lang.StringBuffer result,
IdcPosition fieldPosition)
number - The long to formatresult - Where the text result is appended to.fieldPosition - On input: an alignment field, if desired.
On output: the offsets of the alignment field.
public java.lang.Number parse(java.lang.String text)
throws ParseStringException
ParseStringException
public java.lang.Number parse(java.lang.String text,
ParseStringLocation parsePosition)
Number with a value matching the
given string. The most economical subclass that can represent all the
bits of the source string is chosen.
text - the string to be parsedparsePosition - on entry, where to begin parsing; on exit, just past
the last parsed character. If parsing fails, the index will not move and
the error index will be set.
null if the parse failspublic java.lang.String getPositivePrefix()
Examples: +123, $123, sFr123
public void setPositivePrefix(java.lang.String newValue)
Examples: +123, $123, sFr123
public java.lang.String getNegativePrefix()
Examples: -123, ($123) (with negative suffix), sFr-123
public void setNegativePrefix(java.lang.String newValue)
Examples: -123, ($123) (with negative suffix), sFr-123
public java.lang.String getPositiveSuffix()
Example: 123%
public void setPositiveSuffix(java.lang.String newValue)
Example: 123%
public java.lang.String getNegativeSuffix()
Examples: -123%, ($123) (with positive suffixes)
public void setNegativeSuffix(java.lang.String newValue)
Examples: 123%
public int getMultiplier()
Examples: with 100, 1.23 -> "123", and "123" -> 1.23
public void setMultiplier(int newValue)
Examples: with 100, 1.23 -> "123", and "123" -> 1.23
public int getMaximumIntegerDigits()
setMaximumIntegerDigits(int)public int getMinimumIntegerDigits()
setMinimumIntegerDigits(int)public int getMaximumFractionDigits()
setMaximumFractionDigits(int)public int getMinimumFractionDigits()
setMinimumFractionDigits(int)public void setMinimumFractionDigits(int newValue)
newValue - the minimum number of fraction digits to be shown; if
less than zero, then zero is used. The concrete subclass may enforce an
upper limit to this value appropriate to the numeric type being formatted.getMinimumFractionDigits()public int getGroupingSize()
setGroupingSize(int),
DecimalFormatSymbols.getGroupingSeparator()public void setGroupingSize(int newValue)
getGroupingSize(),
DecimalFormatSymbols.setGroupingSeparator(char)public boolean isDecimalSeparatorAlwaysShown()
Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
public void setDecimalSeparatorAlwaysShown(boolean newValue)
Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean isGroupingUsed()
setGroupingUsed(boolean)public void setGroupingUsed(boolean newValue)
isGroupingUsed()public boolean isParseIntegerOnly()
public void setParseIntegerOnly(boolean value)
isParseIntegerOnly()public int hashCode()
hashCode in class java.lang.Objectpublic void setMaximumIntegerDigits(int newValue)
public void setMinimumIntegerDigits(int newValue)
public void setMaximumFractionDigits(int newValue)
setMaximumFractionDigits(int)public java.lang.String getNaN()
public void setNaN(java.lang.String s)
public java.lang.String getInfinity()
public void setInfinity(java.lang.String s)
public char getZeroDigit()
public void setZeroDigit(char c)
public char getDecimalSeparator()
public void setDecimalSeparator(char c)
public char getGroupingSeparator()
public void setGroupingSeparator(char c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
(c) 1996-2005 All rights reserved. Stellent, Inc. |