org.jscience.mathematics.analysis.expressions
Class Clip

java.lang.Object
  extended by org.jscience.mathematics.analysis.expressions.OperatorExpression
      extended by org.jscience.mathematics.analysis.expressions.QuartaryOperator
          extended by org.jscience.mathematics.analysis.expressions.Clip
All Implemented Interfaces:
java.io.Serializable, Expression, JavaExpressible, XMLExpressible

public class Clip
extends QuartaryOperator

Class representing the clip function.

See Also:
UnaryOperator, Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.analysis.expressions.QuartaryOperator
fourthOperand, secondOperand, thirdOperand
 
Fields inherited from class org.jscience.mathematics.analysis.expressions.OperatorExpression
firstOperand
 
Constructor Summary
Clip(Expression expression, Expression first, Expression second)
          Creates an object that represents the clip function.
Clip(Expression expression1, Expression expression2, Expression first, Expression second)
          Creates an object that represents the clip function.
 
Method Summary
 boolean equals(java.lang.Object e)
          DOCUMENT ME!
 double eval()
          DOCUMENT ME!
 boolean isDifferentiable()
          The clip function is not differentiable so we override the inherited isDifferentiable method.
 boolean isExpandable()
          The clip function is not expandable so we override the inherited isExpandable method.
 Expression optimize()
          DOCUMENT ME!
 Expression replace(Expression a, Expression b)
          DOCUMENT ME!
 java.lang.String toJava()
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 java.lang.String toXML()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.mathematics.analysis.expressions.QuartaryOperator
diff, getElements, getFourthOperand, getSecondOperand, getThirdOperand, setFourthOperand, setSecondOperand, setThirdOperand, toTaylorMap
 
Methods inherited from class org.jscience.mathematics.analysis.expressions.OperatorExpression
contains, factor, getFirstOperand, isolate, isolate, setFirstOperand
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Clip

public Clip(Expression expression1,
            Expression expression2,
            Expression first,
            Expression second)
Creates an object that represents the clip function. If the first expression in the argument list evaluates to a value larger than or equal to the second expression, the third expression is returned, else the fourth expression is returned.

Parameters:
expression1 - Any expression
expression2 - Any expression
first - The value to which the clip function clips if expression1 is larger that expression2
second - The value to which the clip function clips if expression1 is not larger that expression2

Clip

public Clip(Expression expression,
            Expression first,
            Expression second)
Creates an object that represents the clip function. If the expression is positive first is returned else second is returned.

Parameters:
expression - Any expression
first - The value to which the clip function clips if the expression is positive
second - The value to which the clip function clips if the expression is not positive
Method Detail

eval

public double eval()
DOCUMENT ME!

Returns:
DOCUMENT ME!

isDifferentiable

public boolean isDifferentiable()
The clip function is not differentiable so we override the inherited isDifferentiable method.

Specified by:
isDifferentiable in interface Expression
Overrides:
isDifferentiable in class QuartaryOperator
Returns:
DOCUMENT ME!
See Also:
Expression.isDifferentiable()

isExpandable

public boolean isExpandable()
The clip function is not expandable so we override the inherited isExpandable method.

Specified by:
isExpandable in interface Expression
Overrides:
isExpandable in class QuartaryOperator
Returns:
DOCUMENT ME!
See Also:
Expression.isExpandable()

replace

public Expression replace(Expression a,
                          Expression b)
DOCUMENT ME!

Parameters:
a - DOCUMENT ME!
b - DOCUMENT ME!
Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object e)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
e - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

toJava

public java.lang.String toJava()
DOCUMENT ME!

Returns:
DOCUMENT ME!

optimize

public Expression optimize()
DOCUMENT ME!

Returns:
DOCUMENT ME!

toXML

public java.lang.String toXML()
DOCUMENT ME!

Returns:
DOCUMENT ME!