This class represents any output token that can be handled by Parser. More...

Public Member Functions | |
| boolean | isNegative () |
| Indicate whether or not expression is negative. | |
| Error | function (OObject x) |
| Generic function of one parameter. | |
| Error | function (OObject x, OObject y) |
| Generic function of two parameters. | |
| OObject | inverse () |
| Calculate the inverse. | |
| OObject | square () |
| Calculate the square. | |
| OObject | cube () |
| Calculate the cube. | |
| OObject | factorial () |
| Calculate the factorial. | |
| OObject | negate () |
| Negate x. | |
| OObject | add (OObject x) |
| Add an OObject to this. | |
| OObject | subtract (OObject x) |
| Subtract an OObject from this. | |
| OObject | multiply (OObject x) |
| Multiply this by an OObject. | |
| OObject | divide (OObject x) |
| Divide this by an OObject. | |
| OObject | exp () |
| Exponential function. | |
| OObject | combination (OObject x) |
| Combination function applied to x and this. | |
| OObject | permutation (OObject x) |
| Permutation function applied to x and this. | |
| OObject | pow (OObject y) |
| Power function applied to x. | |
| OObject | root (OObject y) |
| Root function applied to y. | |
| OObject | sin (AngleType angleType) |
| Calculate the sine. | |
| OObject | asin (AngleType angleType) |
| Calculate the inverse sine. | |
| OObject | cos (AngleType angleType) |
| Calculate the cosine. | |
| OObject | acos (AngleType angleType) |
| Calculate the inverse cosine. | |
| OObject | tan (AngleType angleType) |
| Calculate the tangent. | |
| OObject | atan (AngleType angleType) |
| Calculate the inverse tangent. | |
| OObject | log10 () |
| Calculate the log (base 10). | |
| OObject | log () |
| Calculate the natural logarithm. | |
| OObject | sqrt () |
| Calculate the square root. | |
| OObject | cuberoot () |
| Calculate the cube root. | |
| OObject | tenx () |
| Calculate ten to the power of x. | |
| OObject | conjugate () |
| Calculate the conjugate. | |
| OObject | and (OObject z) |
| And with another OObject. | |
| OObject | or (OObject z) |
| Or with another OObject. | |
| OObject | xor (OObject z) |
| Xor with another OObject. | |
| boolean | isZero () |
| Test for equality to zero. | |
| StringArray | toHTMLStringVector (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| Function to create an HTML string representation of the OObject. | |
| String | toHTMLString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| Function to create an HTML string representation of the OObject. | |
| StringArray | toHTMLSubString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| Function to create an HTML string representation of the expression. | |
| StringArray | toHTMLParenString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| Function to create an HTML string representation of the expression. | |
| int | compareTo (OObject o) |
| The comparison operator. | |
| void | sort () |
| Sort the class. | |
| OObject | auto_simplify () |
| Carry out automatic simplifications on the OObject. | |
| OObject | substitute (Substitution substitution) |
| Carry out substitutions as specified by a Substitution object. | |
Static Private Attributes | |
| static final Complex | LOG10INV = new Complex( 1 / StrictMath.log( 10 ) ) |
| Used internally. | |
This class represents any output token that can be handled by Parser.
Calculate the inverse cosine.
| angleType | The AngleType |
Referenced by jscicalc.pobject.ACos.function().
Add an OObject to this.
| x | The addend |
References jscicalc.expression.Sum.add().
Referenced by jscicalc.button.MplusButton.actionPerformed(), jscicalc.expression.Sum.add(), jscicalc.expression.Product.auto_simplify(), jscicalc.pobject.Add.function(), jscicalc.expression.Product.Product(), jscicalc.OObject.subtract(), and jscicalc.expression.Dyadic< E extends jscicalc.pobject.PObject >.toHTMLSubString().
And with another OObject.
| z | The number to AND with this. |
References jscicalc.OObject.and().
Referenced by jscicalc.OObject.and(), and jscicalc.pobject.And.function().
Calculate the inverse sine.
| angleType | The AngleType |
Referenced by jscicalc.pobject.ASin.function().
Calculate the inverse tangent.
| angleType | The AngleType |
Referenced by jscicalc.pobject.ATan.function().
| OObject jscicalc.OObject.auto_simplify | ( | ) |
Carry out automatic simplifications on the OObject.
The auto_simplification method is loosely based on the method of Joel S Cohen, Computer Algebra and Symbolic Computation, A K Peters, 2003.
Reimplemented in jscicalc.expression.Dyadic< E extends jscicalc.pobject.PObject >, jscicalc.expression.Monadic, jscicalc.expression.Product, jscicalc.expression.Sum, and jscicalc.expression.SumOrProduct.
Referenced by jscicalc.expression.Sum.auto_simplify(), jscicalc.expression.Product.auto_simplify(), jscicalc.expression.Power.auto_simplify(), jscicalc.expression.Monadic.auto_simplify(), jscicalc.expression.Dyadic< E extends jscicalc.pobject.PObject >.auto_simplify(), jscicalc.Parser.evaluate(), and jscicalc.graph.Locus.substitute().
Combination function applied to x and this.
| x | The value (right of symbol) |
References jscicalc.OObject.combination().
Referenced by jscicalc.OObject.combination(), and jscicalc.pobject.Combination.function().
| int jscicalc.OObject.compareTo | ( | OObject | o | ) |
The comparison operator.
By default returns 0 (Errors are equivalent).
| o | The Expression to be compared. |
Referenced by jscicalc.expression.Product.auto_simplify().
| OObject jscicalc.OObject.conjugate | ( | ) |
Calculate the conjugate.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Conjugate.function().
Calculate the cosine.
| angleType | The AngleType |
Referenced by jscicalc.pobject.Cos.function().
| OObject jscicalc.OObject.cube | ( | ) |
Calculate the cube.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Cube.function().
| OObject jscicalc.OObject.cuberoot | ( | ) |
Calculate the cube root.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.CubeRoot.function().
Divide this by an OObject.
| x | The divisor. |
References jscicalc.OObject.divide(), jscicalc.expression.Product.divide(), and jscicalc.expression.Product.multiply().
Referenced by jscicalc.OObject.divide(), and jscicalc.pobject.Divide.function().
| OObject jscicalc.OObject.exp | ( | ) |
Exponential function.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Exp.function().
| OObject jscicalc.OObject.factorial | ( | ) |
Calculate the factorial.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Factorial.function().
Generic function of two parameters.
| x | The first parameter | |
| y | The second parameter |
Generic function of one parameter.
| x | The value |
Referenced by jscicalc.expression.Dyadic< E extends jscicalc.pobject.PObject >.substitute().
| OObject jscicalc.OObject.inverse | ( | ) |
Calculate the inverse.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Inverse.function(), and jscicalc.OObject.root().
| boolean jscicalc.OObject.isNegative | ( | ) |
Indicate whether or not expression is negative.
The default is not negative.
Reimplemented in jscicalc.complex.Complex, jscicalc.expression.Product, and jscicalc.expression.Sum.
Referenced by jscicalc.expression.Product.isNegative(), and jscicalc.expression.Sum.toHTMLSubString().
| boolean jscicalc.OObject.isZero | ( | ) |
Test for equality to zero.
Reimplemented in jscicalc.complex.Complex, and jscicalc.expression.SumOrProduct.
Referenced by jscicalc.expression.Product.isNegative(), and jscicalc.ExtraPanel.paintComponent().
| OObject jscicalc.OObject.log | ( | ) |
Calculate the natural logarithm.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Ln.function().
| OObject jscicalc.OObject.log10 | ( | ) |
Calculate the log (base 10).
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Log.function().
Multiply this by an OObject.
| x | The multiplier. |
References jscicalc.OObject.multiply(), and jscicalc.expression.Product.multiply().
Referenced by jscicalc.Parser.convertToProduct(), jscicalc.pobject.Multiply.function(), jscicalc.pobject.E.function(), jscicalc.OObject.multiply(), and jscicalc.expression.Sum.rMultiply().
| OObject jscicalc.OObject.negate | ( | ) |
Negate x.
Reimplemented in jscicalc.complex.Complex, jscicalc.expression.Expression, jscicalc.expression.Monadic, jscicalc.expression.Product, jscicalc.expression.Sum, and jscicalc.expression.Variable.
Referenced by jscicalc.Parser.convertDFunctions(), jscicalc.pobject.Uminus.function(), jscicalc.pobject.Subtract.function(), and jscicalc.OObject.subtract().
Or with another OObject.
| z | The number to AND with this. |
References jscicalc.OObject.or().
Referenced by jscicalc.pobject.Or.function(), and jscicalc.OObject.or().
Permutation function applied to x and this.
| x | The value (right of symbol) |
References jscicalc.OObject.permutation().
Referenced by jscicalc.pobject.Permutation.function(), and jscicalc.OObject.permutation().
Power function applied to x.
| y | The value (right of symbol) |
References jscicalc.OObject.pow().
Referenced by jscicalc.pobject.Power.function(), and jscicalc.OObject.pow().
Root function applied to y.
| y | The value (right of symbol) |
References jscicalc.OObject.inverse(), and jscicalc.OObject.root().
Referenced by jscicalc.pobject.Root.function(), and jscicalc.OObject.root().
Calculate the sine.
| angleType | The AngleType |
Referenced by jscicalc.pobject.Sin.function().
| void jscicalc.OObject.sort | ( | ) |
Sort the class.
Does nothing, but subclasses will override.
Reimplemented in jscicalc.expression.Product, and jscicalc.expression.SumOrProduct.
| OObject jscicalc.OObject.sqrt | ( | ) |
Calculate the square root.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.SquareRoot.function().
| OObject jscicalc.OObject.square | ( | ) |
Calculate the square.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.Square.function().
| OObject jscicalc.OObject.substitute | ( | Substitution | substitution | ) |
Carry out substitutions as specified by a Substitution object.
| substitution | The object specifying the substitutions |
Referenced by jscicalc.expression.Sum.substitute(), jscicalc.expression.Product.substitute(), jscicalc.expression.Monadic.substitute(), and jscicalc.graph.Locus.substitute().
Subtract an OObject from this.
| x | The subtrahend |
References jscicalc.OObject.add(), and jscicalc.OObject.negate().
Referenced by jscicalc.button.MminusButton.actionPerformed(), and jscicalc.pobject.Subtract.function().
Calculate the tangent.
| angleType | The AngleType |
Referenced by jscicalc.pobject.Tan.function().
| OObject jscicalc.OObject.tenx | ( | ) |
Calculate ten to the power of x.
Reimplemented in jscicalc.complex.Complex.
Referenced by jscicalc.pobject.TenX.function().
| StringArray jscicalc.OObject.toHTMLParenString | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
Function to create an HTML string representation of the expression.
This has six arguments. See Complex for a definition of the arguments.
This version may put parentheses round the expression.
The default function simply returns ‘Error’ to indicate that no result is known.
This function does not include the html tags.
| maxChars | The maximum number of (visible) characters we can use | |
| precision | The desired number of significant figures | |
| base | The required base | |
| notation | The notation to use to display this value | |
| polarFactor | Not used |
References jscicalc.StringArray.add(), and jscicalc.OObject.toHTMLSubString().
Referenced by jscicalc.expression.Product.toHTMLSubString(), jscicalc.expression.Monadic.toHTMLSubString(), and jscicalc.expression.Factorial.toHTMLSubString().
| String jscicalc.OObject.toHTMLString | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
Function to create an HTML string representation of the OObject.
This has six arguments. See Complex for a definition of the arguments.
The default function simply returns ‘Error’ to indicate that no result is known.
The result is really a string. But we want to scroll over it; so we separate (1) HTML tags, (2) special characters like minus signs, so that each substring represents what will appear on the screen as a single character. When we scroll, we also sometimes want to jump across several characters at once. So we use another level of indirection. Thus, at the first level we get the entities between which we can move the caret. And at the second level, we get a representation of each ‘character’ on the screen (which may correspond to more than one character of HTML code.
| maxChars | The maximum number of (visible) characters we can use | |
| precision | The desired number of significant figures | |
| base | The required base | |
| notation | The notation to use to display this value | |
| polarFactor | Not used |
References jscicalc.OObject.toHTMLSubString().
Referenced by jscicalc.complex.Test.checkNumber(), and jscicalc.DataTransfer.copy().
| StringArray jscicalc.OObject.toHTMLStringVector | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
Function to create an HTML string representation of the OObject.
This has six arguments. See Complex for a definition of the arguments.
The default function simply returns ‘Error’ to indicate that no result is known.
| maxChars | The maximum number of (visible) characters we can use | |
| precision | The desired number of significant figures | |
| base | The required base | |
| notation | The notation to use to display this value | |
| polarFactor | Not used |
References jscicalc.OObject.toHTMLSubString().
Referenced by jscicalc.DisplayLabel.setExpression().
| StringArray jscicalc.OObject.toHTMLSubString | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
Function to create an HTML string representation of the expression.
This has six arguments. See Complex for a definition of the arguments.
The default function simply returns ‘Error’ to indicate that no result is known.
This function does not include the html tags.
| maxChars | The maximum number of (visible) characters we can use | |
| precision | The desired number of significant figures | |
| base | The required base | |
| notation | The notation to use to display this value | |
| polarFactor | Not used |
References jscicalc.StringArray.add().
Referenced by jscicalc.OObject.toHTMLParenString(), jscicalc.OObject.toHTMLString(), jscicalc.OObject.toHTMLStringVector(), jscicalc.expression.Sum.toHTMLSubString(), and jscicalc.expression.Product.toHTMLSubString().
Xor with another OObject.
| z | The number to AND with this. |
References jscicalc.OObject.xor().
Referenced by jscicalc.pobject.Xor.function(), and jscicalc.OObject.xor().
final Complex jscicalc.OObject.LOG10INV = new Complex( 1 / StrictMath.log( 10 ) ) [static, private] |
Used internally.
1.7.1