Class ConstantExpression
java.lang.Object
edu.cmu.tetrad.calculator.expression.ConstantExpression
- All Implemented Interfaces:
Expression
,TetradSerializable
,Serializable
Represents a constant expression, that is an expression that always evaluates to the same value.
- Version:
- $Id: $Id
- Author:
- Tyler Gibson
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConstantExpression
Constant expression for e.static final ConstantExpression
Constant expression for PI. -
Constructor Summary
ConstructorsConstructorDescriptionConstantExpression
(double value) Constructs the constant expression given the value to use. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Evaluates the expression using the given contextgetExpressions.org.apache.commons.math3.distribution.IntegerDistribution
getIntegerDistribution
(Context context) getIntegerDistribution.getName()
Getter for the fieldname
.getPosition.org.apache.commons.math3.distribution.RealDistribution
getRealDistribution
(Context context) getRealDistribution.getToken()
getToken.static ConstantExpression
serializableInstance.toString()
toString.
-
Field Details
-
PI
Constant expression for PI. -
E
Constant expression for e.
-
-
Constructor Details
-
ConstantExpression
public ConstantExpression(double value) Constructs the constant expression given the value to use.- Parameters:
value
- a double
-
-
Method Details
-
serializableInstance
serializableInstance.
- Returns:
- a
ConstantExpression
object
-
getName
Getter for the field
name
.- Returns:
- the name of the constant or null if there isn't one.
-
evaluate
Evaluates the expression using the given context- Specified by:
evaluate
in interfaceExpression
- Parameters:
context
- aContext
object- Returns:
- a double
-
getToken
getToken.
- Specified by:
getToken
in interfaceExpression
- Returns:
- a
String
object
-
getPosition
getPosition.
- Specified by:
getPosition
in interfaceExpression
- Returns:
- a
ExpressionDescriptor.Position
object
-
getExpressions
getExpressions.
- Specified by:
getExpressions
in interfaceExpression
- Returns:
- a
List
object
-
toString
-
getRealDistribution
getRealDistribution.
- Specified by:
getRealDistribution
in interfaceExpression
- Parameters:
context
- aContext
object- Returns:
- a
RealDistribution
object
-
getIntegerDistribution
public org.apache.commons.math3.distribution.IntegerDistribution getIntegerDistribution(Context context) getIntegerDistribution.
- Specified by:
getIntegerDistribution
in interfaceExpression
- Parameters:
context
- aContext
object- Returns:
- a
IntegerDistribution
object
-