first commit
This commit is contained in:
17
hrmsEjb/org/nfunk/jep/function/Not.java
Normal file
17
hrmsEjb/org/nfunk/jep/function/Not.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package org.nfunk.jep.function;
|
||||
|
||||
import java.util.Stack;
|
||||
import org.nfunk.jep.ParseException;
|
||||
|
||||
public class Not extends PostfixMathCommand {
|
||||
public void run(Stack paramStack) throws ParseException {
|
||||
checkStack(paramStack);
|
||||
Number number = (Number)paramStack.pop();
|
||||
if (number instanceof Number) {
|
||||
boolean bool = (((Number)number).doubleValue() == 0.0D) ? true : false;
|
||||
paramStack.push(new Double(bool));
|
||||
} else {
|
||||
throw new ParseException("Invalid parameter type");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user