Public Member Functions | Static Public Member Functions | Package Functions | Private Member Functions

jscicalc.expression.Sum Class Reference

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

Collaboration diagram for jscicalc.expression.Sum:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

This class represents a sum of Expression objects.

expression.

See also:
OObject
Author:
J. D. Lamb
Version:
Revision:
1.6

Constructor & Destructor Documentation

jscicalc.expression.Sum.Sum ( Expression  expression  ) 

Construct a Sum.

Parameters:
expression The expression from which to construct the Sum.

References jscicalc.expression.SumOrProduct.complex, and jscicalc.expression.SumOrProduct.expressionList.

jscicalc.expression.Sum.Sum (  ) 

Member Function Documentation

Sum jscicalc.expression.Sum.add ( Complex  z  ) 

Add a Complex to this.

Parameters:
z The complex to add
Returns:
The sum

References jscicalc.complex.Complex.add(), jscicalc.expression.Sum.clone(), and jscicalc.expression.SumOrProduct.complex.

Referenced by jscicalc.OObject.add().

OObject jscicalc.expression.Sum.add ( Product  x  ) 
OObject jscicalc.expression.Sum.add ( Sum  x  ) 
OObject jscicalc.expression.Sum.auto_simplify (  ) 
Sum jscicalc.expression.Sum.clone (  ) 
int jscicalc.expression.Sum.compareTo ( Sum  sum  ) 

The comparison operator.

Parameters:
sum The Sum to be compared.
Returns:
integer indicating how expression is compared to this.

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]
OObject jscicalc.expression.Sum.multiply ( Sum  t  )  [package]
Sum jscicalc.expression.Sum.negate (  )  [virtual]
OObject jscicalc.expression.Sum.rMultiply ( OObject  o  )  [private]
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.

Parameters:
maxChars ignored
precision ignored
base ignored
notation ignored
polarFactor ignored
Returns:
a String representing the variable.

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.

Returns:
simplified expression

References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.complex.Complex.isZero().

Referenced by jscicalc.expression.Sum.auto_simplify().


The documentation for this class was generated from the following file: