Class ExecutionContext
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.common.function.type4.ExecutionContext
-
public class ExecutionContext extends Object
Makes up the execution context, holding the available operators and the execution stack.
-
-
Constructor Summary
Constructors Constructor Description ExecutionContext(Operators operatorSet)Creates a new execution context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OperatorsgetOperators()Returns the operator set used by this execution context.Stack<Object>getStack()Returns the stack used by this execution context.intpopInt()Pops a value of type int from the stack.NumberpopNumber()Pops a number (int or real) from the stack.floatpopReal()Pops a number from the stack and returns it as a real value.
-
-
-
Constructor Detail
-
ExecutionContext
public ExecutionContext(Operators operatorSet)
Creates a new execution context.- Parameters:
operatorSet- the operator set
-
-
Method Detail
-
getStack
public Stack<Object> getStack()
Returns the stack used by this execution context.- Returns:
- the stack
-
getOperators
public Operators getOperators()
Returns the operator set used by this execution context.- Returns:
- the operator set
-
popNumber
public Number popNumber()
Pops a number (int or real) from the stack. If it's neither data type, a ClassCastException is thrown.- Returns:
- the number
-
popInt
public int popInt()
Pops a value of type int from the stack. If the value is not of type int, a ClassCastException is thrown.- Returns:
- the int value
-
popReal
public float popReal()
Pops a number from the stack and returns it as a real value. If the value is not of a numeric type, a ClassCastException is thrown.- Returns:
- the real value
-
-