public abstract class AbstractStandardEvaluator extends AbstractEvaluator implements StandardEvaluator
StandardEvaluator implementations on common
built-in types: Booleans, Strings and Numbers.
This class is a big bag of case logic for various operators and types. Looking at it, you might think: "It sure would be nice to modularize this, with each operation in its own class, with properly declared types, and called dynamically at runtime as appropriate."
"Great idea!" I would reply. Then I would suggest you have a look at the SciJava Ops and ImageJ Ops projects, which do exactly that in an extensible way.
Or maybe you are thinking: "This can't possibly work as well as awesome JVM-based scripting languages like Jython and Groovy..."
To which I would reply: "You are absolutely right! This class is mostly just
a demonstration of an extensible, working evaluator built using the
org.scijava.parsington.eval package. If your use case is only
concerned with feature-rich evaluation of standard types, then building on
top of a scripting language might make more sense."
| Constructor and Description |
|---|
AbstractStandardEvaluator() |
AbstractStandardEvaluator(ExpressionParser parser) |
get, getParser, isStrict, set, setAll, setStrictclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAssign, andAssign, assign, divAssign, dotDivAssign, dotPowAssign, dotRightDivAssign, execute, leftShiftAssign, modAssign, mulAssign, orAssign, postDec, postInc, powAssign, preDec, preInc, rightDivAssign, rightShiftAssign, subAssign, unsignedRightShiftAssignpublic AbstractStandardEvaluator()
public AbstractStandardEvaluator(ExpressionParser parser)
public Object function(Object a, Object b)
StandardEvaluatorFunction operator.function in interface StandardEvaluatora - The first argument.b - The second argument.public Object dot(Object a, Object b)
StandardEvaluatorOperators.DOT operator.dot in interface StandardEvaluatora - The first argument.b - The second argument.public Object parens(Object... args)
StandardEvaluatorOperators.PARENS operator.parens in interface StandardEvaluatorargs - The arguments.public Object brackets(Object... args)
StandardEvaluatorOperators.BRACKETS operator.brackets in interface StandardEvaluatorargs - The arguments.public Object braces(Object... args)
StandardEvaluatorOperators.BRACES operator.braces in interface StandardEvaluatorargs - The arguments.public Object transpose(Object a)
StandardEvaluatorOperators.TRANSPOSE operator.transpose in interface StandardEvaluatora - The argument.public Object dotTranspose(Object a)
StandardEvaluatorOperators.DOT_TRANSPOSE operator.dotTranspose in interface StandardEvaluatora - The argument.public Object pow(Object a, Object b)
StandardEvaluatorOperators.POW operator.pow in interface StandardEvaluatora - The first argument.b - The second argument.public double pow(double a,
double b)
public BigInteger pow(BigInteger a, int b)
public BigDecimal pow(BigDecimal a, int b)
public Object dotPow(Object a, Object b)
StandardEvaluatorOperators.DOT_POW operator.dotPow in interface StandardEvaluatora - The first argument.b - The second argument.public Object pos(Object a)
StandardEvaluatorOperators.POS operator.pos in interface StandardEvaluatora - The argument.public int pos(int num)
public long pos(long num)
public float pos(float num)
public double pos(double num)
public Object neg(Object a)
StandardEvaluatorOperators.NEG operator.neg in interface StandardEvaluatora - The argument.public int neg(int num)
public long neg(long num)
public float neg(float num)
public double neg(double num)
public BigInteger neg(BigInteger num)
public BigDecimal neg(BigDecimal num)
public Object complement(Object a)
StandardEvaluatorOperators.COMPLEMENT operator.complement in interface StandardEvaluatora - The argument.public int complement(int a)
public long complement(long a)
public Object not(Object a)
StandardEvaluatorOperators.NOT operator.not in interface StandardEvaluatora - The argument.public boolean not(boolean a)
public Object mul(Object a, Object b)
StandardEvaluatorOperators.MUL operator.mul in interface StandardEvaluatora - The first argument.b - The second argument.public int mul(int a,
int b)
public long mul(long a,
long b)
public float mul(float a,
float b)
public double mul(double a,
double b)
public BigInteger mul(BigInteger a, BigInteger b)
public BigDecimal mul(BigDecimal a, BigDecimal b)
public Object div(Object a, Object b)
StandardEvaluatorOperators.DIV operator.div in interface StandardEvaluatora - The first argument.b - The second argument.public int div(int a,
int b)
public long div(long a,
long b)
public float div(float a,
float b)
public double div(double a,
double b)
public BigInteger div(BigInteger a, BigInteger b)
public BigDecimal div(BigDecimal a, BigDecimal b)
public Object mod(Object a, Object b)
StandardEvaluatorOperators.MOD operator.mod in interface StandardEvaluatora - The first argument.b - The second argument.public int mod(int a,
int b)
public long mod(long a,
long b)
public float mod(float a,
float b)
public double mod(double a,
double b)
public BigInteger mod(BigInteger a, BigInteger b)
public BigDecimal mod(BigDecimal a, BigDecimal b)
public Object rightDiv(Object a, Object b)
StandardEvaluatorOperators.RIGHT_DIV operator.rightDiv in interface StandardEvaluatora - The first argument.b - The second argument.public Object dotMul(Object a, Object b)
StandardEvaluatorOperators.DOT_MUL operator.dotMul in interface StandardEvaluatora - The first argument.b - The second argument.public Object dotDiv(Object a, Object b)
StandardEvaluatorOperators.DOT_DIV operator.dotDiv in interface StandardEvaluatora - The first argument.b - The second argument.public Object dotRightDiv(Object a, Object b)
StandardEvaluatorOperators.DOT_RIGHT_DIV operator.dotRightDiv in interface StandardEvaluatora - The first argument.b - The second argument.public Object add(Object a, Object b)
StandardEvaluatorOperators.ADD operator.add in interface StandardEvaluatora - The first argument.b - The second argument.public int add(int a,
int b)
public long add(long a,
long b)
public float add(float a,
float b)
public double add(double a,
double b)
public BigInteger add(BigInteger a, BigInteger b)
public BigDecimal add(BigDecimal a, BigDecimal b)
public Object sub(Object a, Object b)
StandardEvaluatorOperators.SUB operator.sub in interface StandardEvaluatora - The first argument.b - The second argument.public int sub(int a,
int b)
public long sub(long a,
long b)
public float sub(float a,
float b)
public double sub(double a,
double b)
public BigInteger sub(BigInteger a, BigInteger b)
public BigDecimal sub(BigDecimal a, BigDecimal b)
public Object leftShift(Object a, Object b)
StandardEvaluatorOperators.LEFT_SHIFT operator.leftShift in interface StandardEvaluatora - The first argument.b - The second argument.public int leftShift(int a,
int b)
public long leftShift(long a,
long b)
public BigInteger leftShift(BigInteger a, int b)
public Object rightShift(Object a, Object b)
StandardEvaluatorOperators.RIGHT_SHIFT operator.rightShift in interface StandardEvaluatora - The first argument.b - The second argument.public int rightShift(int a,
int b)
public long rightShift(long a,
long b)
public BigInteger rightShift(BigInteger a, int b)
public Object unsignedRightShift(Object a, Object b)
StandardEvaluatorOperators.UNSIGNED_RIGHT_SHIFT operator.unsignedRightShift in interface StandardEvaluatora - The first argument.b - The second argument.public int unsignedRightShift(int a,
int b)
public long unsignedRightShift(long a,
long b)
public Object lessThan(Object a, Object b)
StandardEvaluatorOperators.LESS_THAN operator.lessThan in interface StandardEvaluatora - The first argument.b - The second argument.public <T> boolean lessThan(Comparable<T> a, T b)
public Object greaterThan(Object a, Object b)
StandardEvaluatorOperators.GREATER_THAN operator.greaterThan in interface StandardEvaluatora - The first argument.b - The second argument.public <T> boolean greaterThan(Comparable<T> a, T b)
public Object lessThanOrEqual(Object a, Object b)
StandardEvaluatorOperators.LESS_THAN_OR_EQUAL operator.lessThanOrEqual in interface StandardEvaluatora - The first argument.b - The second argument.public <T> boolean lessThanOrEqual(Comparable<T> a, T b)
public Object greaterThanOrEqual(Object a, Object b)
StandardEvaluatorOperators.GREATER_THAN_OR_EQUAL operator.greaterThanOrEqual in interface StandardEvaluatora - The first argument.b - The second argument.public <T> boolean greaterThanOrEqual(Comparable<T> a, T b)
public Object instanceOf(Object a, Object b)
StandardEvaluatorOperators.INSTANCEOF operator.instanceOf in interface StandardEvaluatora - The first argument.b - The second argument.public Object equal(Object a, Object b)
StandardEvaluatorOperators.EQUAL operator.equal in interface StandardEvaluatora - The first argument.b - The second argument.public Object notEqual(Object a, Object b)
StandardEvaluatorOperators.NOT_EQUAL operator.notEqual in interface StandardEvaluatora - The first argument.b - The second argument.public Object bitwiseAnd(Object a, Object b)
StandardEvaluatorOperators.BITWISE_AND operator.bitwiseAnd in interface StandardEvaluatora - The first argument.b - The second argument.public int bitwiseAnd(int a,
int b)
public long bitwiseAnd(long a,
long b)
public BigInteger bitwiseAnd(BigInteger a, BigInteger b)
public Object bitwiseOr(Object a, Object b)
StandardEvaluatorOperators.BITWISE_OR operator.bitwiseOr in interface StandardEvaluatora - The first argument.b - The second argument.public int bitwiseOr(int a,
int b)
public long bitwiseOr(long a,
long b)
public BigInteger bitwiseOr(BigInteger a, BigInteger b)
public Object logicalAnd(Object a, Object b)
StandardEvaluatorOperators.LOGICAL_AND operator.logicalAnd in interface StandardEvaluatora - The first argument.b - The second argument.public boolean logicalAnd(boolean a,
boolean b)
public Object logicalOr(Object a, Object b)
StandardEvaluatorOperators.LOGICAL_OR operator.logicalOr in interface StandardEvaluatora - The first argument.b - The second argument.public boolean logicalOr(boolean a,
boolean b)
public Object question(Object a, Object b)
StandardEvaluatorOperators.QUESTION operator.question in interface StandardEvaluatora - The first argument.b - The second argument.public Object colon(Object a, Object b)
StandardEvaluatorOperators.COLON operator.colon in interface StandardEvaluatora - The first argument.b - The second argument.Copyright © 2015–2021 SciJava. All rights reserved.