Type objects.
| Modifier and Type | Field and Description |
|---|---|
| private final int | maxStack
The maximum number of stack slots this OperandStack instance may hold. |
| private ArrayList | stack
We hold the stack information here. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | OperandStack(final int maxStack, final ObjectType obj)
Creates an otherwise empty stack with a maximum of maxStack slots and the ObjectType 'obj' at the top. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Object | clone()
Overrides java. |
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides java. |
| public OperandStack | |
| public int | Returns: a hash code value for the object.Overrides java. |
| public void | initializeObject(final UninitializedObjectType u)
Deprecated
as a consequence of
Replaces all occurrences of u in this OperandStack instance with an "initialized" ObjectType.
UninitializedObjectType being deprecated.
|
| public boolean | |
| public int | |
| public void | |
| public Type | |
| public Type | peek(final int i)
Returns the element that's i elements below the top element; that means, iff i==0 the top element is returned. |
| public Type | |
| public Type | |
| public void | |
| public int | |
| public int | |
| public String | toString()
Overrides java. |
| maxStack | back to summary |
|---|---|
| private final int maxStack The maximum number of stack slots this OperandStack instance may hold. | |
| stack | back to summary |
|---|---|
| private ArrayList<Type> stack We hold the stack information here. | |
| OperandStack | back to summary |
|---|---|
| public OperandStack(final int maxStack) Creates an empty stack with a maximum of maxStack slots. | |
| OperandStack | back to summary |
|---|---|
| public OperandStack(final int maxStack, final ObjectType obj) Creates an otherwise empty stack with a maximum of maxStack slots and the ObjectType 'obj' at the top. | |
| clear | back to summary |
|---|---|
| public void clear() Clears the stack. | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Returns a deep copy of this object; that means, the clone operates on a new stack. However, the Type objects on the stack are shared.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Returns true if and only if this OperandStack equals another, meaning equal lengths and equal objects on the stacks.
| |
| getClone | back to summary |
|---|---|
| public OperandStack getClone() Returns a (typed!) clone of this.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initializeObject | back to summary |
|---|---|
| public void initializeObject(final UninitializedObjectType u)
Deprecated as a consequence of Replaces all occurrences of u in this OperandStack instance with an "initialized" ObjectType. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns true IFF this OperandStack is empty. | |
| maxStack | back to summary |
|---|---|
| public int maxStack() Returns the number of stack slots this stack can hold. | |
| merge | back to summary |
|---|---|
| public void merge(final OperandStack s) 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 | back to summary |
|---|---|
| public Type peek() Returns the element on top of the stack. The element is not popped off the stack! | |
| peek | back to summary |
|---|---|
| public Type peek(final int i) Returns the element that's i elements below the top element; that means, iff i==0 the top element is returned. The element is not popped off the stack! | |
| pop | back to summary |
|---|---|
| public Type pop() Returns the element on top of the stack. The element is popped off the stack. | |
| pop | back to summary |
|---|---|
| public Type pop(final int count) Pops i elements off the stack. Always returns null.
| |
| push | back to summary |
|---|---|
| public void push(final Type type) Pushes a Type object onto the stack. | |
| size | back to summary |
|---|---|
| public int size() Returns the size of this OperandStack; that means, how many Type objects there are. | |
| slotsUsed | back to summary |
|---|---|
| public int slotsUsed() Returns the number of stack slots used.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a String representation of this OperandStack instance.
| |