|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.text.Format
org.apache.commons.math.util.CompositeFormat
public abstract class CompositeFormat
Base class for formatters of composite objects (complex numbers, vectors ...).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.text.Format |
---|
Format.Field |
Constructor Summary | |
---|---|
CompositeFormat()
|
Method Summary | |
---|---|
protected StringBuffer |
formatDouble(double value,
NumberFormat format,
StringBuffer toAppendTo,
FieldPosition pos)
Formats a double value to produce a string. |
protected static NumberFormat |
getDefaultNumberFormat()
Create a default number format. |
protected static NumberFormat |
getDefaultNumberFormat(Locale locale)
Create a default number format. |
protected void |
parseAndIgnoreWhitespace(String source,
ParsePosition pos)
Parses source until a non-whitespace character is found. |
protected boolean |
parseFixedstring(String source,
String expected,
ParsePosition pos)
Parse source for an expected fixed string. |
protected char |
parseNextCharacter(String source,
ParsePosition pos)
Parses source until a non-whitespace character is found. |
protected Number |
parseNumber(String source,
NumberFormat format,
ParsePosition pos)
Parses source for a number. |
Methods inherited from class java.text.Format |
---|
clone, format, format, formatToCharacterIterator, parseObject, parseObject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeFormat()
Method Detail |
---|
protected static NumberFormat getDefaultNumberFormat()
NumberFormat.getInstance()
with the only customizing that the
maximum number of fraction digits is set to 2.
protected static NumberFormat getDefaultNumberFormat(Locale locale)
NumberFormat.getInstance(java.util.Locale)
with the only
customizing that the maximum number of fraction digits is set to 2.
locale
- the specific locale used by the format.
protected void parseAndIgnoreWhitespace(String source, ParsePosition pos)
source
until a non-whitespace character is found.
source
- the string to parsepos
- input/ouput parsing parameter. On output, pos
holds the index of the next non-whitespace character.protected char parseNextCharacter(String source, ParsePosition pos)
source
until a non-whitespace character is found.
source
- the string to parsepos
- input/ouput parsing parameter.
protected Number parseNumber(String source, NumberFormat format, ParsePosition pos)
source
for a number. This method can parse normal,
numeric values as well as special values. These special values include
Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY.
source
- the string to parseformat
- the number format used to parse normal, numeric values.pos
- input/ouput parsing parameter.
protected boolean parseFixedstring(String source, String expected, ParsePosition pos)
source
for an expected fixed string.
source
- the string to parseexpected
- expected stringpos
- input/ouput parsing parameter.
protected StringBuffer formatDouble(double value, NumberFormat format, StringBuffer toAppendTo, FieldPosition pos)
format
. There are
three exceptions to this:
value
- the double to format.format
- the format used.toAppendTo
- where the text is to be appendedpos
- On input: an alignment field, if desired. On output: the
offsets of the alignment field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |