| java.lang.Object java.text.Format org.apache.commons.math.complex.ComplexFormat
ComplexFormat | public class ComplexFormat extends Format implements Serializable(Code) | | Formats a Complex number in cartesian format "Re(c) + Im(c)i". 'i' can
be replaced with 'j', and the number format for both real and imaginary parts
can be configured.
author: Apache Software Foundation version: $Revision: 348519 $ $Date: 2005-11-23 12:12:18 -0700 (Wed, 23 Nov 2005) $ |
Constructor Summary | |
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 format) Create an instance with a custom number format for both real and
imaginary parts. | public | ComplexFormat(NumberFormat realFormat, NumberFormat 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 imaginaryCharacter) Create an instance with a custom imaginary character, and the default
number format for both real and imaginary parts. | public | ComplexFormat(String imaginaryCharacter, NumberFormat format) Create an instance with a custom imaginary character, and a custom number
format for both real and imaginary parts. | public | ComplexFormat(String imaginaryCharacter, NumberFormat realFormat, NumberFormat 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. |
ComplexFormat | public ComplexFormat()(Code) | | Create an instance with the default imaginary character, 'i', and the
default number format for both real and imaginary parts.
|
ComplexFormat | public ComplexFormat(NumberFormat format)(Code) | | Create an instance with a custom number format for both real and
imaginary parts.
Parameters: format - the custom format for both real and imaginary parts. |
ComplexFormat | public ComplexFormat(NumberFormat realFormat, NumberFormat imaginaryFormat)(Code) | | Create an instance with a custom number format for the real part and a
custom number format for the imaginary part.
Parameters: realFormat - the custom format for the real part. Parameters: imaginaryFormat - the custom format for the imaginary part. |
ComplexFormat | public ComplexFormat(String imaginaryCharacter)(Code) | | Create an instance with a custom imaginary character, and the default
number format for both real and imaginary parts.
Parameters: imaginaryCharacter - The custom imaginary character. |
ComplexFormat | public ComplexFormat(String imaginaryCharacter, NumberFormat format)(Code) | | Create an instance with a custom imaginary character, and a custom number
format for both real and imaginary parts.
Parameters: imaginaryCharacter - The custom imaginary character. Parameters: format - the custom format for both real and imaginary parts. |
ComplexFormat | public ComplexFormat(String imaginaryCharacter, NumberFormat realFormat, NumberFormat imaginaryFormat)(Code) | | 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.
Parameters: imaginaryCharacter - The custom imaginary character. Parameters: realFormat - the custom format for the real part. Parameters: imaginaryFormat - the custom format for the imaginary part. |
format | public StringBuffer format(Complex complex, StringBuffer toAppendTo, FieldPosition pos)(Code) | | Formats a
Complex object to produce a string.
Parameters: complex - the object to format. Parameters: toAppendTo - where the text is to be appended Parameters: pos - On input: an alignment field, if desired. On output: theoffsets of the alignment field the value passed in as toAppendTo. |
formatComplex | public static String formatComplex(Complex c)(Code) | | This static method calls formatComplex() on a default instance of
ComplexFormat.
Parameters: c - Complex object to format A formatted number in the form "Re(c) + Im(c)i" |
getAvailableLocales | public static Locale[] getAvailableLocales()(Code) | | Get the set of locales for which complex formats are available. This
is the same set as the
NumberFormat set.
available complex format locales. |
getImaginaryCharacter | public String getImaginaryCharacter()(Code) | | Access the imaginaryCharacter.
the imaginaryCharacter. |
getImaginaryFormat | public NumberFormat getImaginaryFormat()(Code) | | Access the imaginaryFormat.
the imaginaryFormat. |
getInstance | public static ComplexFormat getInstance()(Code) | | Returns the default complex format for the current locale.
the default complex format. |
getInstance | public static ComplexFormat getInstance(Locale locale)(Code) | | Returns the default complex format for the given locale.
Parameters: locale - the specific locale used by the format. the complex format specific to the given locale. |
getRealFormat | public NumberFormat getRealFormat()(Code) | | Access the realFormat.
the realFormat. |
setImaginaryCharacter | public void setImaginaryCharacter(String imaginaryCharacter)(Code) | | Modify the imaginaryCharacter.
Parameters: imaginaryCharacter - The new imaginaryCharacter value. throws: IllegalArgumentException - if imaginaryCharacter isnull or an empty string. |
setImaginaryFormat | public void setImaginaryFormat(NumberFormat imaginaryFormat)(Code) | | Modify the imaginaryFormat.
Parameters: imaginaryFormat - The new imaginaryFormat value. throws: IllegalArgumentException - if imaginaryFormat isnull . |
|
|