org.norther.tammi.acorn.math
Class Product

java.lang.Object
  extended by java.lang.Number
      extended by org.norther.tammi.acorn.math.Equation
          extended by org.norther.tammi.acorn.math.Product
All Implemented Interfaces:
Serializable, Comparable<Number>

public class Product
extends Equation

A product equation.

Version:
$Id: Product.java,v 1.1 2009/12/09 19:57:53 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
Product(boolean ignoreNaNs, double... operands)
          Constructs a new double equation.
Product(boolean ignoreNaNs, float... operands)
          Constructs a new float equation.
Product(byte... operands)
          Constructs a new byte equation.
Product(double... operands)
          Constructs a new double equation.
Product(float... operands)
          Constructs a new float equation.
Product(int... operands)
          Constructs a new int equation.
Product(long... operands)
          Constructs a new long equation.
Product(short... operands)
          Constructs a new short equation.
 
Method Summary
protected  Number calculate(Object operands, int length, boolean ignoreNaNs)
          Calculates the result.
 
Methods inherited from class org.norther.tammi.acorn.math.Equation
byteValue, byteValue, compareTo, doubleValue, doubleValue, equals, floatValue, floatValue, getLength, getOperandType, getResult, intValue, intValue, isFloatingPoint, longValue, longValue, shortValue, shortValue, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Product

public Product(byte... operands)
Constructs a new byte equation.

Parameters:
operands - the operands.

Product

public Product(short... operands)
Constructs a new short equation.

Parameters:
operands - the operands.

Product

public Product(int... operands)
Constructs a new int equation.

Parameters:
operands - the operands.

Product

public Product(long... operands)
Constructs a new long equation.

Parameters:
operands - the operands.

Product

public Product(float... operands)
Constructs a new float equation.

Parameters:
operands - the operands.

Product

public Product(boolean ignoreNaNs,
               float... operands)
Constructs a new float equation.

Parameters:
ignoreNaNs - ignore NaNs if true.
operands - the operands.

Product

public Product(double... operands)
Constructs a new double equation.

Parameters:
operands - the operands.

Product

public Product(boolean ignoreNaNs,
               double... operands)
Constructs a new double equation.

Parameters:
ignoreNaNs - ignore NaNs if true.
operands - the operands.
Method Detail

calculate

protected Number calculate(Object operands,
                           int length,
                           boolean ignoreNaNs)
Description copied from class: Equation
Calculates the result.

Specified by:
calculate in class Equation
Parameters:
operands - an array of operands.
length - the number of operands.
ignoreNaNs - ignore NaNs if true.
Returns:
the result of the equation.


Copyright © 2004 The Norther Organization. All rights reserved.