com.singularsys.jep.functions
Class Logical

java.lang.Object
  extended by com.singularsys.jep.functions.PostfixMathCommand
      extended by com.singularsys.jep.functions.BinaryFunction
          extended by com.singularsys.jep.functions.Logical
All Implemented Interfaces:
PostfixMathCommandI, java.io.Serializable

public class Logical
extends BinaryFunction

Logical operators AND and OR. No longer used by default after having added LazyLogical in Jep 3.1.0.

See Also:
Serialized Form

Field Summary
protected  boolean allowNumbers
           
static int AND
           
static int OR
           
 
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, name, NaN, numberOfParameters
 
Constructor Summary
Logical(int id_in)
          Standard constructor, allows Boolean and Number arguments
Logical(int id, boolean disallowNumbers)
          Constructor which restricts type of arguments.
 
Method Summary
 java.lang.Object eval(java.lang.Object l, java.lang.Object r)
           
 
Methods inherited from class com.singularsys.jep.functions.BinaryFunction
run
 
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, checkStack, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND

public static final int AND
See Also:
Constant Field Values

OR

public static final int OR
See Also:
Constant Field Values

allowNumbers

protected boolean allowNumbers
Constructor Detail

Logical

public Logical(int id_in)
Standard constructor, allows Boolean and Number arguments

Parameters:
id_in - either of the constants AND or OR

Logical

public Logical(int id,
               boolean disallowNumbers)
Constructor which restricts type of arguments.

Parameters:
id - either of the constants AND or OR
disallowNumbers - if true Number arguments will raise exceptions, otherwise as thee Standard constructor.
Method Detail

eval

public java.lang.Object eval(java.lang.Object l,
                             java.lang.Object r)
                      throws EvaluationException
Specified by:
eval in class BinaryFunction
Throws:
EvaluationException


Copyright © 2010 Singular Systems http://www.singularsys.com/jep