Constructor and Description |
---|
OperandStack(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.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the stack.
|
Object |
clone()
Returns a deep copy of this object; that means, the clone operates
on a new stack.
|
boolean |
equals(Object o)
Returns true if and only if this OperandStack
equals another, meaning equal lengths and equal
objects on the stacks.
|
OperandStack |
getClone()
Returns a (typed!) clone of this.
|
int |
hashCode() |
void |
initializeObject(UninitializedObjectType u)
Replaces all occurences of u in this OperandStack instance
with an "initialized" ObjectType.
|
boolean |
isEmpty()
Returns true IFF this OperandStack is empty.
|
int |
maxStack()
Returns the number of stack slots this stack can hold.
|
void |
merge(OperandStack s)
Merges another stack state into this instance's stack state.
|
Type |
peek()
Returns the element on top of the stack.
|
Type |
peek(int i)
Returns the element that's i elements below the top element; that means,
iff i==0 the top element is returned.
|
Type |
pop()
Returns the element on top of the stack.
|
Type |
pop(int i)
Pops i elements off the stack.
|
void |
push(Type type)
Pushes a Type object onto the stack.
|
int |
size()
Returns the size of this OperandStack; that means, how many Type objects there are.
|
int |
slotsUsed()
Returns the number of stack slots used.
|
String |
toString()
Returns a String representation of this OperandStack instance.
|
public OperandStack(int maxStack)
public OperandStack(int maxStack, ObjectType obj)
public Object clone()
public void clear()
public int hashCode()
public boolean equals(Object o)
public OperandStack getClone()
clone()
public boolean isEmpty()
public int maxStack()
public Type peek()
public Type peek(int i)
public Type pop()
public Type pop(int i)
public void push(Type type)
public int size()
public int slotsUsed()
maxStack()
public String toString()
public void merge(OperandStack s)
public void initializeObject(UninitializedObjectType u)
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.