Class OperandStack
java.lang.Object
org.apache.bcel.verifier.structurals.OperandStack
- All Implemented Interfaces:
Cloneable
This class implements a stack used for symbolic JVM stack simulation. [It's used as an operand stack substitute.]
Elements of this stack are
Type objects.-
Constructor Summary
ConstructorsConstructorDescriptionOperandStack(int maxStack) Creates an empty stack with a maximum of maxStack slots.OperandStack(int maxStack, ObjectType obj) Creates an otherwise empty stack with a maximum of maxStack slots and the ObjectType 'obj' at the top. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the stack.clone()Returns a deep copy of this object; that means, the clone operates on a new stack.booleanReturns true if and only if this OperandStack equals another, meaning equal lengths and equal objects on the stacks.getClone()Returns a (typed!)inthashCode()voidReplaces all occurrences of u in this OperandStack instance with an "initialized" ObjectType.booleanisEmpty()Returns true IFF this OperandStack is empty.intmaxStack()Returns the number of stack slots this stack can hold.voidMerges another stack state into this instance's stack state.peek()Returns the element on top of the stack.peek(int i) Returns the element that's i elements below the top element; that means, iff i==0 the top element is returned.pop()Returns the element on top of the stack.pop(int count) Pops i elements off the stack.voidPushes a Type object onto the stack.intsize()Returns the size of this OperandStack; that means, how many Type objects there are.intReturns the number of stack slots used.toString()Returns a String representation of this OperandStack instance.
-
Constructor Details
-
OperandStack
Creates an empty stack with a maximum of maxStack slots. -
OperandStack
Creates an otherwise empty stack with a maximum of maxStack slots and the ObjectType 'obj' at the top.
-
-
Method Details
-
clear
Clears the stack. -
clone
-
equals
-
getClone
-
hashCode
-
initializeObject
Replaces all occurrences of u in this OperandStack instance with an "initialized" ObjectType. -
isEmpty
Returns true IFF this OperandStack is empty. -
maxStack
Returns the number of stack slots this stack can hold. -
merge
Merges another stack state into this instance's stack state. See the Java Virtual Machine Specification, Second Edition, page 146: 4.9.2 for details. -
peek
-
peek
-
pop
-
pop
-
push
-
size
Returns the size of this OperandStack; that means, how many Type objects there are. -
slotsUsed
-
toString
-