| Modifier and Type | Field and Description |
|---|---|
| private static final String | DEFAULT_IMAGINARY_CHARACTER
The default imaginary character. |
| private final String | imaginaryCharacter
The notation used to signify the imaginary part of the complex number. |
| private final NumberFormat | imaginaryFormat
The format used for the imaginary part. |
| private final NumberFormat | realFormat
The format used for the real part. |
| Access | Constructor and Description |
|---|---|
| public | ComplexFormat()
Create an instance with the default imaginary character, 'i', and the default number format for both real and imaginary parts. |
| public | ComplexFormat(NumberFormat
the custom format for both real and imaginary parts. format)Create an instance with a custom number format for both real and imaginary parts. |
| public | ComplexFormat(NumberFormat
the custom format for the real part. realFormat, NumberFormat the custom format for the imaginary part. imaginaryFormat)Create an instance with a custom number format for the real part and a custom number format for the imaginary part. |
| public | ComplexFormat(String
The custom imaginary character. imaginaryCharacter)Create an instance with a custom imaginary character, and the default number format for both real and imaginary parts. |
| public | ComplexFormat(String
The custom imaginary character. imaginaryCharacter, NumberFormat the custom format for both real and imaginary parts. format)Create an instance with a custom imaginary character, and a custom number format for both real and imaginary parts. |
| public | ComplexFormat(String
The custom imaginary character. imaginaryCharacter, NumberFormat the custom format for the real part. realFormat, NumberFormat the custom format for the imaginary part. imaginaryFormat)Create an instance with a custom imaginary character, a custom number format for the real part, and a custom number format for the imaginary part. |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: A formatted number in the form "Re(c) + Im(c)i".Complex object to format. c)This method calls |
| public String | Returns: A formatted number.Double object to format. c)This method calls |
| public StringBuffer | Returns: the value passed in as toAppendTo.the object to format. complex, StringBuffer where the text is to be appended toAppendTo, FieldPosition On input: an alignment field, if desired. On output: the
offsets of the alignment field pos)Formats a |
| public StringBuffer | Returns: the value passed in as toAppendTo.the object to format. obj, StringBuffer where the text is to be appended toAppendTo, FieldPosition On input: an alignment field, if desired. On output: the
offsets of the alignment field pos)Formats a object to produce a string. |
| private StringBuffer | Returns: the value passed in as toAppendTo.Absolute value of the imaginary part of a complex number. absIm, StringBuffer where the text is to be appended. toAppendTo, FieldPosition On input: an alignment field, if desired. On output: the
offsets of the alignment field. pos)Format the absolute value of the imaginary part. |
| public static Locale[] | Returns: available complex format locales.Get the set of locales for which complex formats are available. |
| public String | |
| public NumberFormat | |
| public static ComplexFormat | Returns: the default complex format.Returns the default complex format for the current locale. |
| public static ComplexFormat | Returns: the complex format specific to the given locale.the specific locale used by the format. locale)Returns the default complex format for the given locale. |
| public static ComplexFormat | Returns: the complex format specific to the given locale.Imaginary character. imaginaryCharacter, Locale the specific locale used by the format. locale)Returns the default complex format for the given locale. |
| public NumberFormat | |
| public Complex | |
| public Complex | Returns: the parsedComplex object.the string to parse source, ParsePosition input/ouput parsing parameter. pos)Parses a string to produce a |
| DEFAULT_IMAGINARY_CHARACTER | back to summary |
|---|---|
| private static final String DEFAULT_IMAGINARY_CHARACTER The default imaginary character. | |
| imaginaryCharacter | back to summary |
|---|---|
| private final String imaginaryCharacter The notation used to signify the imaginary part of the complex number. | |
| imaginaryFormat | back to summary |
|---|---|
| private final NumberFormat imaginaryFormat The format used for the imaginary part. | |
| realFormat | back to summary |
|---|---|
| private final NumberFormat realFormat The format used for the real part. | |
| ComplexFormat | back to summary |
|---|---|
| public ComplexFormat() Create an instance with the default imaginary character, 'i', and the default number format for both real and imaginary parts. | |
| ComplexFormat | back to summary |
|---|---|
| public ComplexFormat(NumberFormat format) throws NullArgumentException Create an instance with a custom number format for both real and imaginary parts.
| |
| ComplexFormat | back to summary |
|---|---|
| public ComplexFormat(NumberFormat realFormat, NumberFormat imaginaryFormat) throws NullArgumentException Create an instance with a custom number format for the real part and a custom number format for the imaginary part.
| |
| ComplexFormat | back to summary |
|---|---|
| public ComplexFormat(String imaginaryCharacter) throws NullArgumentException, NoDataException Create an instance with a custom imaginary character, and the default number format for both real and imaginary parts.
| |
| ComplexFormat | back to summary |
|---|---|
| public ComplexFormat(String imaginaryCharacter, NumberFormat format) throws NullArgumentException, NoDataException Create an instance with a custom imaginary character, and a custom number format for both real and imaginary parts.
| |
| ComplexFormat | back to summary |
|---|---|
| public ComplexFormat(String imaginaryCharacter, NumberFormat realFormat, NumberFormat imaginaryFormat) throws NullArgumentException, NoDataException Create an instance with a custom imaginary character, a custom number format for the real part, and a custom number format for the imaginary part.
| |
| format | back to summary |
|---|---|
| public String format(Complex c) This method calls | |
| format | back to summary |
|---|---|
| public String format(Double c) This method calls | |
| format | back to summary |
|---|---|
| public StringBuffer format(Complex complex, StringBuffer toAppendTo, FieldPosition pos) Formats a
| |
| format | back to summary |
|---|---|
| public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) throws MathIllegalArgumentException Formats a object to produce a string.
| |
| formatImaginary | back to summary |
|---|---|
| private StringBuffer formatImaginary(double absIm, StringBuffer toAppendTo, FieldPosition pos) Format the absolute value of the imaginary part.
| |
| getAvailableLocales | back to summary |
|---|---|
| public static Locale[] getAvailableLocales() Get the set of locales for which complex formats are available. This is the same set as the
| |
| getImaginaryCharacter | back to summary |
|---|---|
| public String getImaginaryCharacter() Access the imaginaryCharacter.
| |
| getImaginaryFormat | back to summary |
|---|---|
| public NumberFormat getImaginaryFormat() Access the imaginaryFormat.
| |
| getInstance | back to summary |
|---|---|
| public static ComplexFormat getInstance() Returns the default complex format for the current locale.
| |
| getInstance | back to summary |
|---|---|
| public static ComplexFormat getInstance(Locale locale) Returns the default complex format for the given locale.
| |
| getInstance | back to summary |
|---|---|
| public static ComplexFormat getInstance(String imaginaryCharacter, Locale locale) throws NullArgumentException, NoDataException Returns the default complex format for the given locale.
| |
| getRealFormat | back to summary |
|---|---|
| public NumberFormat getRealFormat() Access the realFormat.
| |
| parse | back to summary |
|---|---|
| public Complex parse(String source) throws MathParseException Parses a string to produce a
| |
| parse | back to summary |
|---|---|
| public Complex parse(String source, ParsePosition pos) Parses a string to produce a
| |