Package com.singularsys.extensions.xjep
Class FieldTreeUtils
- java.lang.Object
-
- com.singularsys.extensions.xjep.TreeUtils
-
- com.singularsys.extensions.xjep.FieldTreeUtils
-
- All Implemented Interfaces:
JepComponent
,java.io.Serializable
public class FieldTreeUtils extends TreeUtils
The TreeUtility functions adapted to work with a Field.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FieldTreeUtils(FieldI field)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIntValue(java.lang.Object val)
Convert value to integer.boolean
isInfinityVal(java.lang.Object val)
Uses a field to test for a value equals +/- infinity Some fields may not have infinite valuesboolean
isIntegerVal(java.lang.Object val)
Uses theIntegerConvertor
interface of a field to test for integer values.boolean
isMinusOneVal(java.lang.Object value)
Uses a field to test for -1boolean
isNaNVal(java.lang.Object val)
Uses a field to test for a NaN value Some fields may not have NaN valuesboolean
isNegativeVal(java.lang.Object value)
Uses a field to test for negative valuesboolean
isOneVal(java.lang.Object value)
Uses a field to test for a value equals oneboolean
isPositiveVal(java.lang.Object value)
Uses a field to test for a positive valueboolean
isZeroVal(java.lang.Object value)
Uses a field to test for a value equals zero-
Methods inherited from class com.singularsys.extensions.xjep.TreeUtils
complexValue, getChildrenAsArray, getCI, getCMinusI, getCMinusOne, getCOne, getCZero, getFalse, getLightWeightInstance, getMinusOne, getNAN, getNegativeInfinity, getOne, getPositiveInfinity, getTrue, getTwo, getZero, hasInfinity, hasNaN, init, intValue, isBinaryOperator, isComplex, isComplexVal, isConstant, isConstantVariable, isFunction, isInfinity, isInteger, isMinusOne, isNaN, isNegative, isOne, isOperator, isPositive, isReal, isRealVal, isUnaryOperator, isVariable, isZero, setChildrenIfNeeded
-
-
-
-
Constructor Detail
-
FieldTreeUtils
public FieldTreeUtils(FieldI field)
Constructor- Parameters:
field
- the field to use
-
-
Method Detail
-
isMinusOneVal
public boolean isMinusOneVal(java.lang.Object value)
Uses a field to test for -1- Overrides:
isMinusOneVal
in classTreeUtils
- Parameters:
value
- value to test- Returns:
- true in value is -1 false otherwise
-
isNegativeVal
public boolean isNegativeVal(java.lang.Object value)
Uses a field to test for negative values- Overrides:
isNegativeVal
in classTreeUtils
- Parameters:
value
- value to test- Returns:
- true in value is negative false otherwise
-
isOneVal
public boolean isOneVal(java.lang.Object value)
Uses a field to test for a value equals one
-
isPositiveVal
public boolean isPositiveVal(java.lang.Object value)
Uses a field to test for a positive value- Overrides:
isPositiveVal
in classTreeUtils
- Parameters:
value
- value to test- Returns:
- true in value is positive false otherwise
-
isZeroVal
public boolean isZeroVal(java.lang.Object value)
Uses a field to test for a value equals zero
-
isInfinityVal
public boolean isInfinityVal(java.lang.Object val)
Uses a field to test for a value equals +/- infinity Some fields may not have infinite values- Overrides:
isInfinityVal
in classTreeUtils
- Parameters:
val
- value to test- Returns:
- true in value is infinite false otherwise
-
isNaNVal
public boolean isNaNVal(java.lang.Object val)
Uses a field to test for a NaN value Some fields may not have NaN values
-
isIntegerVal
public boolean isIntegerVal(java.lang.Object val)
Uses theIntegerConvertor
interface of a field to test for integer values.- Overrides:
isIntegerVal
in classTreeUtils
- Parameters:
val
- value to test- Returns:
- true in value is positive false otherwise
-
getIntValue
public int getIntValue(java.lang.Object val) throws EvaluationException
Convert value to integer. AssumesisIntegerVal(Object)
return true- Overrides:
getIntValue
in classTreeUtils
- Parameters:
val
- value to convert- Returns:
- val converted to an integer
- Throws:
EvaluationException
- if the field does not implementIntegerConvertor
or the conversion failed.
-
-