|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.text.Format orbital.math.ArithmeticFormat
public class ArithmeticFormat
ArithmeticFormat is responsible for formatting and parsing arithmetic objects.
With this instance of Format it is possible to format as well as parse the various arithmetic objects.
Although there is a getInstance(Locale)
method that is aware of a locale,
this class will most likely be instantiated in a locale-independent manner
using scientific mathematical notation (see getDefaultInstance()
).
Anyway, ArithmeticFormat's formatting details can be configured
to fit different notation requirements.
You can adjust the output of pure real numbers of an ArithmeticFormat by modifying
the corresponding properties of its getNumberFormat()
instance.
However, to adjust the common format on the whole math system, use MathUtilities.getDefaultPrecisionDigits()
, etc.
NumberFormat.INTEGER_FIELD
,
NumberFormat.FRACTION_FIELD
,
NumberFormat
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class java.text.Format |
---|
java.text.Format.Field |
Field Summary | |
---|---|
static int |
DENOMINATOR_FIELD
|
static int |
IMAGINARY_FIELD
|
static ArithmeticFormat |
MATH_EXPORT_FORMAT
A formatter producing parsable output as exportable to systems like Mathematica. |
static int |
NUMERATOR_FIELD
|
static int |
REAL_FIELD
|
static int |
SYMBOL_FIELD
|
Constructor Summary | |
---|---|
ArithmeticFormat(java.util.Locale locale)
Create a new arithmetic formatter for a specific locale. |
Method Summary | |
---|---|
java.lang.String |
format(Arithmetic obj)
Get a formatted string representation of an arithmetic object. |
java.lang.StringBuffer |
format(Arithmetic obj,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
|
java.lang.String |
format(Complex obj)
Specialization of format. |
java.lang.StringBuffer |
format(Complex v,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Fraction obj)
Specialization of format. |
java.lang.StringBuffer |
format(Fraction as,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Integer obj)
Specialization of format. |
java.lang.StringBuffer |
format(Integer v,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(MathFunctor obj)
Specialization of format. |
java.lang.StringBuffer |
format(MathFunctor f,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Matrix obj)
Specialization of format. |
java.lang.StringBuffer |
format(Matrix v,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.StringBuffer |
format(java.lang.Object obj,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
|
java.lang.String |
format(Polynomial obj)
Specialization of format. |
java.lang.StringBuffer |
format(Polynomial p,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Quotient obj)
Specialization of format. |
java.lang.StringBuffer |
format(Quotient q,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Rational obj)
Specialization of format. |
java.lang.StringBuffer |
format(Rational v,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Real obj)
Specialization of format. |
java.lang.StringBuffer |
format(Real v,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Scalar obj)
Specialization of format. |
java.lang.StringBuffer |
format(Scalar obj,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format, formatting scalar objects as they please. |
java.lang.String |
format(Symbol obj)
Specialization of format. |
java.lang.StringBuffer |
format(Symbol s,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Tensor obj)
Specialization of format. |
java.lang.StringBuffer |
format(Tensor obj,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format, formatting tensor objects as they please. |
java.lang.String |
format(UnivariatePolynomial obj)
Specialization of format. |
java.lang.StringBuffer |
format(UnivariatePolynomial p,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
java.lang.String |
format(Vector obj)
Specialization of format. |
java.lang.StringBuffer |
format(Vector v,
java.lang.StringBuffer result,
java.text.FieldPosition fieldPosition)
Specialization of format. |
static ArithmeticFormat |
getDefaultInstance()
Get the default instance of format that does scientific mathematical formatting. |
static ArithmeticFormat |
getInstance()
Returns the default number format for the current default locale. |
static ArithmeticFormat |
getInstance(java.util.Locale locale)
|
java.text.NumberFormat |
getNumberFormat()
Get the inner number format used to format pure real numbers. |
java.lang.String |
getPolynomialVariable()
|
Arithmetic |
parse(java.lang.String source)
Parse an arithmetic object string representation. |
Arithmetic |
parse(java.lang.String source,
java.text.ParsePosition status)
Parse an arithmetic object string representation. |
java.lang.Object |
parseObject(java.lang.String source,
java.text.ParsePosition status)
|
protected void |
setNumberFormat(java.text.NumberFormat newNumberFormat)
Set the inner number format used to format pure real numbers. |
void |
setPolynomialVariable(java.lang.String polynomialVariable)
Set the denotation of the formal parameter of polynomials. |
Methods inherited from class java.text.Format |
---|
clone, format, formatToCharacterIterator, parseObject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NUMERATOR_FIELD
public static final int DENOMINATOR_FIELD
public static final int REAL_FIELD
public static final int IMAGINARY_FIELD
public static final int SYMBOL_FIELD
public static final ArithmeticFormat MATH_EXPORT_FORMAT
Constructor Detail |
---|
public ArithmeticFormat(java.util.Locale locale)
Method Detail |
---|
public static ArithmeticFormat getInstance(java.util.Locale locale)
public static ArithmeticFormat getInstance()
getDefaultInstance()
,
"FacadeFactory"public static final ArithmeticFormat getDefaultInstance()
Object.toString()
methods in this package.
NumberFormat.getScientificInstance()
,
"FacadeFactory"public java.lang.String getPolynomialVariable()
public void setPolynomialVariable(java.lang.String polynomialVariable)
polynomialVariable
- the string that is used to denote the formal parameter X of R[X].public java.text.NumberFormat getNumberFormat()
protected void setNumberFormat(java.text.NumberFormat newNumberFormat)
public java.lang.String format(Arithmetic obj)
Format.format(Object)
public java.lang.String format(Scalar obj)
public java.lang.String format(Tensor obj)
public java.lang.String format(Vector obj)
public java.lang.String format(Matrix obj)
public java.lang.String format(Complex obj)
public java.lang.String format(Real obj)
public java.lang.String format(Rational obj)
public java.lang.String format(Integer obj)
public java.lang.String format(Polynomial obj)
public java.lang.String format(UnivariatePolynomial obj)
public java.lang.String format(Quotient obj)
public java.lang.String format(Fraction obj)
public java.lang.String format(Symbol obj)
public java.lang.String format(MathFunctor obj)
public java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
format
in class java.text.Format
public java.lang.StringBuffer format(Arithmetic obj, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Scalar obj, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Tensor obj, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Vector v, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Matrix v, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Complex v, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Real v, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Rational v, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Integer v, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Polynomial p, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(UnivariatePolynomial p, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Quotient q, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Fraction as, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(Symbol s, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public java.lang.StringBuffer format(MathFunctor f, java.lang.StringBuffer result, java.text.FieldPosition fieldPosition)
public Arithmetic parse(java.lang.String source, java.text.ParsePosition status)
NumberFormat.parse(String, ParsePosition)
public java.lang.Object parseObject(java.lang.String source, java.text.ParsePosition status)
parseObject
in class java.text.Format
public Arithmetic parse(java.lang.String source) throws java.text.ParseException
java.text.ParseException
parse(String, ParsePosition)
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |