Package hec.hecmath.computation
Class MathOperation
java.lang.Object
hec.hecmath.computation.MathOperation
- All Implemented Interfaces:
Constants
,Evaluable
,Updatable
,UpdatableListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface hec.hecmath.computation.Constants
Constants.LogicTestOperator, Constants.MathOperator, Constants.Notation, Constants.Precedence, Constants.QualityOperator, Constants.QualityTestOperator, Constants.TextOperator, Constants.TextTestOperator, Constants.ValueTestOperator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected static boolean
protected Evaluable[]
protected boolean
protected static boolean
protected static Map<Constants.MathOperator,
String> protected Constants.MathOperator
protected static Map<String,
Constants.MathOperator> protected boolean
protected boolean
protected static boolean
protected Set<UpdatableListener>
protected Object
protected Object
protected double
-
Constructor Summary
ConstructorsConstructorDescriptionMathOperation
(Constants.MathOperator op, boolean persistent, Evaluable... args) MathOperation
(Constants.MathOperator op, boolean persistent, List<? extends Evaluable> args) MathOperation
(Constants.MathOperator op, Evaluable... args) MathOperation
(Constants.MathOperator op, List<? extends Evaluable> args) MathOperation
(String name, boolean persistent, Evaluable... args) MathOperation
(String name, boolean persistent, List<? extends Evaluable> args) MathOperation
(String name, Evaluable... args) MathOperation
(String name, List<? extends Evaluable> args) -
Method Summary
Modifier and TypeMethodDescriptionstatic int
static String
protected void
compute()
void
double
evaluate()
boolean
static boolean
boolean
static boolean
getName()
getNames()
int
boolean
static boolean
static boolean
isMathOperation
(String name) boolean
isStale()
protected static double
void
static int
precedence
(String name) protected static double
quantile
(Evaluable[] l, int subsets, int position, boolean exceptionOnUndefined, boolean tolerateUndefined) void
void
registerListener
(UpdatableListener listener) void
setAllowDenormal
(boolean setting) static void
setAllowDenormalByDefault
(boolean setting) void
setExceptionOnUndefined
(boolean setting) static void
setExceptionOnUndefinedByDefault
(boolean setting) void
setTolerateUndefined
(boolean setting) static void
setTolerateUndefinedByDefault
(boolean setting) toNotation
(Constants.Notation notation) toString()
void
void
void
unregisterListener
(UpdatableListener listener)
-
Field Details
-
tolerateUndefinedByDefault
protected static boolean tolerateUndefinedByDefault -
exceptionOnUndefinedByDefault
protected static boolean exceptionOnUndefinedByDefault -
allowDenormalByDefault
protected static boolean allowDenormalByDefault -
nameByOp
-
opByName
-
value
protected double value -
op
-
stale
protected boolean stale -
args
-
tolerateUndefined
protected boolean tolerateUndefined -
exceptionOnUndefined
protected boolean exceptionOnUndefined -
allowDenormal
protected boolean allowDenormal -
updateListeners
-
updateListenersLock
-
updateSources
-
updateSourcesLock
-
-
Constructor Details
-
MathOperation
- Throws:
ComputationException
-
MathOperation
- Throws:
ComputationException
-
MathOperation
public MathOperation(Constants.MathOperator op, List<? extends Evaluable> args) throws ComputationException - Throws:
ComputationException
-
MathOperation
- Throws:
ComputationException
-
MathOperation
public MathOperation(String name, boolean persistent, List<? extends Evaluable> args) throws ComputationException - Throws:
ComputationException
-
MathOperation
public MathOperation(String name, boolean persistent, Evaluable... args) throws ComputationException - Throws:
ComputationException
-
MathOperation
public MathOperation(Constants.MathOperator op, boolean persistent, List<? extends Evaluable> args) throws ComputationException - Throws:
ComputationException
-
MathOperation
public MathOperation(Constants.MathOperator op, boolean persistent, Evaluable... args) throws ComputationException - Throws:
ComputationException
-
-
Method Details
-
getNames
-
isMathOperation
-
arity
-
precedence
-
arityName
-
getTolerateUndefinedByDefault
public static boolean getTolerateUndefinedByDefault() -
setTolerateUndefinedByDefault
public static void setTolerateUndefinedByDefault(boolean setting) -
getExceptionOnUndefinedByDefault
public static boolean getExceptionOnUndefinedByDefault() -
setExceptionOnUndefinedByDefault
public static void setExceptionOnUndefinedByDefault(boolean setting) -
getAllowDenormalByDefault
public static boolean getAllowDenormalByDefault() -
setAllowDenormalByDefault
public static void setAllowDenormalByDefault(boolean setting) -
quantile
protected static double quantile(Evaluable[] l, int subsets, int position, boolean exceptionOnUndefined, boolean tolerateUndefined) throws ComputationException - Throws:
ComputationException
-
mode
protected static double mode(Evaluable[] l, boolean exceptionOnUndefined, boolean tolerateUndefined) throws ComputationException - Throws:
ComputationException
-
registerListener
- Specified by:
registerListener
in interfaceUpdatable
-
unregisterListener
- Specified by:
unregisterListener
in interfaceUpdatable
-
notifyListeners
public void notifyListeners()- Specified by:
notifyListeners
in interfaceUpdatable
-
registerAsListener
- Specified by:
registerAsListener
in interfaceUpdatableListener
-
unregisterAsListener
- Specified by:
unregisterAsListener
in interfaceUpdatableListener
-
unregisterAsListener
public void unregisterAsListener()- Specified by:
unregisterAsListener
in interfaceUpdatableListener
-
dataUpdated
- Specified by:
dataUpdated
in interfaceUpdatableListener
-
getName
-
getPrecedence
public int getPrecedence() -
isStale
public boolean isStale() -
evaluate
- Specified by:
evaluate
in interfaceEvaluable
- Throws:
ComputationException
-
evaluateToString
- Specified by:
evaluateToString
in interfaceEvaluable
- Throws:
ComputationException
-
getTolerateUndefined
public boolean getTolerateUndefined()- Specified by:
getTolerateUndefined
in interfaceEvaluable
-
getExceptionOnUndefined
public boolean getExceptionOnUndefined()- Specified by:
getExceptionOnUndefined
in interfaceEvaluable
-
getAllowDenormal
public boolean getAllowDenormal()- Specified by:
getAllowDenormal
in interfaceEvaluable
-
setTolerateUndefined
public void setTolerateUndefined(boolean setting) - Specified by:
setTolerateUndefined
in interfaceEvaluable
-
setExceptionOnUndefined
public void setExceptionOnUndefined(boolean setting) - Specified by:
setExceptionOnUndefined
in interfaceEvaluable
-
setAllowDenormal
public void setAllowDenormal(boolean setting) - Specified by:
setAllowDenormal
in interfaceEvaluable
-
toString
-
toNotation
- Specified by:
toNotation
in interfaceEvaluable
- Throws:
ComputationException
-
compute
- Throws:
ComputationException
-