Public Member Functions | Static Public Member Functions | Protected Attributes | Package Functions

jscicalc.expression.Product Class Reference

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

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

List of all members.

Public Member Functions

 Product (Expression expression, final boolean inverse)
 Construct a Product.
 Product ()
 Construct a Product.
Product clone ()
 Create a copy of this Product.
OObject multiply (Complex z)
 Multiply a Complex by this.
OObject divide (Complex z)
 Divide this by a Complex.
Product negate ()
 Get the negative of this.
OObject multiply (Product x)
 multiply this by a product
OObject divide (Product x)
 Divide this by a product.
boolean isNegative ()
 Indicate whether or not expression is negative.
OObject unBox ()
 Return either this or the first expression in this if this is just a container for a single object.
int compareTo (Product product)
 The comparison operator.
jscicalc.StringArray toHTMLSubString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor)
 Function to create an HTML string representation of the Product.
jscicalc.StringArray toHTMLParenString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor)
jscicalc.StringArray toHTMLParenStringL (int maxChars, int precision, final Base base, final Notation notation, double polarFactor)
 Function to create an HTML string representation of the expression.
void sort ()
 Sort the class.
OObject auto_simplify ()
 Simplify a Product expression.
OObject substitute (jscicalc.Substitution substitution)

Static Public Member Functions

static void main (String[] args)

Protected Attributes

java.util.LinkedList< ExpressiondivisorList
 The divisor Expression objects.

Package Functions

void setComplex (Complex z)
 Set the Complex value.
OObject integer_power (long n)
 Compute an integer power.

Detailed Description

This class represents a product of Expression objects.

expression.

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

Constructor & Destructor Documentation

jscicalc.expression.Product.Product ( Expression  expression,
final boolean  inverse 
)

Construct a Product.

Parameters:
expression The expression from which to construct the Product.
inverse Set to true or false according as you want expression or 1/expression

References jscicalc.OObject.add(), jscicalc.expression.SumOrProduct.complex, jscicalc.complex.Complex.divide(), jscicalc.expression.Product.divisorList, and jscicalc.expression.SumOrProduct.expressionList.

jscicalc.expression.Product.Product (  ) 

Member Function Documentation

OObject jscicalc.expression.Product.auto_simplify (  ) 
Product jscicalc.expression.Product.clone (  ) 
int jscicalc.expression.Product.compareTo ( Product  product  ) 

The comparison operator.

Parameters:
product The Product to be compared.
Returns:
integer indicating how expression is compared to this.

References jscicalc.expression.SumOrProduct.compare(), jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.expression.Product.sort().

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

OObject jscicalc.expression.Product.divide ( Complex  z  ) 

Divide this by a Complex.

Parameters:
z The complex to divide by
Returns:
The product

References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, and jscicalc.complex.Complex.divide().

Referenced by jscicalc.OObject.divide().

OObject jscicalc.expression.Product.divide ( Product  x  ) 
OObject jscicalc.expression.Product.integer_power ( long  n  )  [package]

Compute an integer power.

This just means taking the integer power of each expression and creating a new Product. Note that this will not work for non-integer powers.

Parameters:
n The integer (actually a long)
Returns:
An integer power

References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.pow(), and jscicalc.expression.Product.Product().

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

boolean jscicalc.expression.Product.isNegative (  ) 
static void jscicalc.expression.Product.main ( String[]  args  )  [static]
OObject jscicalc.expression.Product.multiply ( Product  x  ) 

multiply this by a product

Parameters:
x The product to multiply by.
Returns:
The product of this and x.

References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.complex.Complex.multiply().

OObject jscicalc.expression.Product.multiply ( Complex  z  ) 

Multiply a Complex by this.

Parameters:
z The complex to multiply by
Returns:
The product

References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, and jscicalc.complex.Complex.multiply().

Referenced by jscicalc.expression.Power.auto_simplify(), jscicalc.OObject.divide(), and jscicalc.OObject.multiply().

Product jscicalc.expression.Product.negate (  )  [virtual]
void jscicalc.expression.Product.setComplex ( Complex  z  )  [package]

Set the Complex value.

Parameters:
z The new value of the complex in the Product.

References jscicalc.expression.SumOrProduct.complex.

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

void jscicalc.expression.Product.sort (  ) 
OObject jscicalc.expression.Product.substitute ( jscicalc.Substitution  substitution  ) 
jscicalc.StringArray jscicalc.expression.Product.toHTMLParenString ( int  maxChars,
int  precision,
final Base  base,
final Notation  notation,
double  polarFactor 
)
jscicalc.StringArray jscicalc.expression.Product.toHTMLParenStringL ( 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.

This version of the function is designed to be used with LFunctions like square and cube, where, for example the square of minus x has to use parentheses (as opposed to cos, where it might not need them.

This function does not include the html tags.

Parameters:
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
Returns:
a String of at most maxChars HTML characters representing the expression

References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.StringArray.StringArray(), jscicalc.complex.Complex.toHTMLParenString(), and jscicalc.expression.Product.toHTMLSubString().

jscicalc.StringArray jscicalc.expression.Product.toHTMLSubString ( int  maxChars,
int  precision,
final Base  base,
final Notation  notation,
double  polarFactor 
)

Function to create an HTML string representation of the Product.

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.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.StringArray.StringArray(), jscicalc.OObject.toHTMLParenString(), jscicalc.complex.Complex.toHTMLParenString(), and jscicalc.OObject.toHTMLSubString().

Referenced by jscicalc.expression.Product.toHTMLParenString(), and jscicalc.expression.Product.toHTMLParenStringL().

OObject jscicalc.expression.Product.unBox (  ) 

Member Data Documentation

java.util.LinkedList<Expression> jscicalc.expression.Product.divisorList [protected]

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