|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.web3d.util.SimpleStack
A stack that has a minimal implementation and no syncrhonisation.
This stack is designed to be used in a high-speed, single threaded environment. It is directly backed by an array for fast access.
Stack| Constructor Summary | |
SimpleStack()
Constructs a new, empty hashtable with a default capacity and load factor, which is 20 respectively. |
|
SimpleStack(int initialCapacity)
Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is 0.75. |
|
| Method Summary | |
void |
clear()
Clears this stack so that it contains no values. |
boolean |
contains(java.lang.Object value)
Returns true if this stack contains an instance of the value. |
boolean |
isEmpty()
Tests if this stack maps no values. |
java.lang.Object |
peek()
Peek at the value on the top of the stack without removing it. |
java.lang.Object |
pop()
Pop the value from the top of the stack. |
void |
push(java.lang.Object val)
Push a new value onto the top of the stack. |
void |
remove(java.lang.Object obj)
Remove the given object from the stack if it exists. |
int |
size()
Returns the number of keys in this hashtable. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleStack()
public SimpleStack(int initialCapacity)
initialCapacity - the initial capacity of the hashtable.
java.lang.IllegalArgumentException - if the initial capacity is less
than zero.| Method Detail |
public int size()
public boolean isEmpty()
true if this stack has no valuespublic void push(java.lang.Object val)
val - The new value for the stack.
public java.lang.Object peek()
throws java.util.EmptyStackException
java.util.EmptyStackException - The stack is currently emptypublic java.lang.Object pop()
public boolean contains(java.lang.Object value)
.equals(). If the stack is currently empty this will always
return false. The search order is from the top of the stack towards the
bottom.
value - The value whose presence in this stack is to be tested.
public void remove(java.lang.Object obj)
obj - The object to be removedpublic void clear()
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||