This class represents a sum of Expression objects. More...

Public Member Functions | |
| Sum (Expression expression) | |
| Construct a Sum. | |
| Sum () | |
| Construct a Sum. | |
| Sum | add (Complex z) |
| Add a Complex to this. | |
| Sum | clone () |
| Create a copy of this Sum. | |
| boolean | isNegative () |
| Indicate whether or not expression is negative. | |
| jscicalc.StringArray | toHTMLSubString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| Function to create an HTML string representation of the Sum. | |
| jscicalc.StringArray | toHTMLParenString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| OObject | add (Product x) |
| Add a Product to this. | |
| OObject | add (Sum x) |
| Add a sum to this. | |
| Sum | negate () |
| Get the negative of this. | |
| OObject | unBox () |
| Return either this or the first expression in this if this is just a container for a single object. | |
| int | compareTo (Sum sum) |
| The comparison operator. | |
| OObject | auto_simplify () |
| Simplify a Sum expression. | |
| OObject | substitute (jscicalc.Substitution substitution) |
Static Public Member Functions | |
| static void | main (String[] args) |
Package Functions | |
| OObject | multiply (Sum t) |
| Multiply this by a Sum t: that is, find this * t. | |
Private Member Functions | |
| OObject | rMultiply (OObject o) |
| Right multiply this by o: that is, find this * o. | |
This class represents a sum of Expression objects.
expression.
| jscicalc.expression.Sum.Sum | ( | Expression | expression | ) |
Construct a Sum.
| expression | The expression from which to construct the Sum. |
References jscicalc.expression.SumOrProduct.complex, and jscicalc.expression.SumOrProduct.expressionList.
| jscicalc.expression.Sum.Sum | ( | ) |
Construct a Sum.
References jscicalc.expression.SumOrProduct.complex, and jscicalc.expression.SumOrProduct.expressionList.
Referenced by jscicalc.expression.Sum.clone(), jscicalc.expression.Sum.main(), jscicalc.expression.Sum.multiply(), jscicalc.expression.Sum.negate(), and jscicalc.expression.Sum.rMultiply().
Add a Complex to this.
| z | The complex to add |
References jscicalc.complex.Complex.add(), jscicalc.expression.Sum.clone(), and jscicalc.expression.SumOrProduct.complex.
Referenced by jscicalc.OObject.add().
Add a Product to this.
| x | The addend |
References jscicalc.complex.Complex.add(), jscicalc.expression.Sum.clone(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.expression.Product.unBox().
Add a sum to this.
| x | The addend |
References jscicalc.OObject.add(), jscicalc.complex.Complex.add(), jscicalc.expression.Sum.clone(), jscicalc.expression.SumOrProduct.complex, and jscicalc.expression.SumOrProduct.expressionList.
| OObject jscicalc.expression.Sum.auto_simplify | ( | ) |
Simplify a Sum expression.
Returns Error or Complex or jscicalc.Sum.
Reimplemented from jscicalc.expression.SumOrProduct.
References jscicalc.complex.Complex.add(), jscicalc.OObject.auto_simplify(), jscicalc.expression.Product.compareTo(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.expression.SumOrProduct.getComplex(), jscicalc.complex.Complex.multiply(), jscicalc.expression.Product.setComplex(), jscicalc.expression.SumOrProduct.sort(), jscicalc.expression.Product.unBox(), and jscicalc.expression.Sum.unBox().
Referenced by jscicalc.expression.Sum.substitute().
| Sum jscicalc.expression.Sum.clone | ( | ) |
Create a copy of this Sum.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.expression.SumOrProduct.getExpressionList(), jscicalc.complex.Complex.imaginary(), jscicalc.complex.Complex.real(), and jscicalc.expression.Sum.Sum().
Referenced by jscicalc.expression.Sum.add(), and jscicalc.expression.Sum.substitute().
| int jscicalc.expression.Sum.compareTo | ( | Sum | sum | ) |
The comparison operator.
| sum | The Sum to be compared. |
References jscicalc.expression.SumOrProduct.compare(), jscicalc.complex.Complex.compareTo(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.expression.SumOrProduct.sort().
| boolean jscicalc.expression.Sum.isNegative | ( | ) |
Indicate whether or not expression is negative.
The default is not negative.
Reimplemented from jscicalc.OObject.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.isNegative(), and jscicalc.complex.Complex.isZero().
| static void jscicalc.expression.Sum.main | ( | String[] | args | ) | [static] |
References jscicalc.expression.Sum.Sum().
Multiply this by a Sum t: that is, find this * t.
| t | Another Sum |
References jscicalc.complex.Complex.add(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.expression.SumOrProduct.getExpressionList(), jscicalc.expression.Sum.rMultiply(), and jscicalc.expression.Sum.Sum().
| Sum jscicalc.expression.Sum.negate | ( | ) | [virtual] |
Get the negative of this.
Implements jscicalc.expression.Expression.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.negate(), and jscicalc.expression.Sum.Sum().
Right multiply this by o: that is, find this * o.
| o | An OObject |
References jscicalc.complex.Complex.add(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.expression.SumOrProduct.getExpressionList(), jscicalc.OObject.multiply(), and jscicalc.expression.Sum.Sum().
Referenced by jscicalc.expression.Sum.multiply().
| OObject jscicalc.expression.Sum.substitute | ( | jscicalc.Substitution | substitution | ) |
| jscicalc.StringArray jscicalc.expression.Sum.toHTMLParenString | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
| jscicalc.StringArray jscicalc.expression.Sum.toHTMLSubString | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
Function to create an HTML string representation of the Sum.
The arguments are ignored except for the Complex.
| maxChars | ignored | |
| precision | ignored | |
| base | ignored | |
| notation | ignored | |
| polarFactor | ignored |
References jscicalc.StringArray.add(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.isNegative(), jscicalc.OObject.isNegative(), jscicalc.StringArray.StringArray(), jscicalc.complex.Complex.toHTMLSubString(), and jscicalc.OObject.toHTMLSubString().
Referenced by jscicalc.expression.Sum.toHTMLParenString().
| OObject jscicalc.expression.Sum.unBox | ( | ) |
Return either this or the first expression in this if this is just a container for a single object.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.complex.Complex.isZero().
Referenced by jscicalc.expression.Sum.auto_simplify().
1.7.1