|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.util.IntList
de.enough.polish.util.IntStack
public class IntStack
Provides a lifo stack for primitive int types
Copyright Enough Software 2007 - 2010
| Constructor Summary | |
|---|---|
IntStack()
Creates a new stack with the initial capacity of 10 and a growth factor of 75% |
|
IntStack(int initialCapacity)
Creates a new stack with the given initial capacity and a growth factor of 75% |
|
IntStack(int initialCapacity,
int growthFactor)
Creates a new stack |
|
| Method Summary | |
|---|---|
boolean |
empty()
Determines whether this stack is empty |
int |
peek()
Returns the element that has been added last without removing it. |
int |
pop()
Returns the element that has been added last and removes it at the same time. |
void |
push(int element)
Pushes an element on the stack. |
int |
search(int element)
Returns the 1-based position where an object is on this stack. |
| Methods inherited from class de.enough.polish.util.IntList |
|---|
add, add, clear, contains, get, getInternalArray, indexOf, read, removeElement, removeElementAt, set, size, toArray, toString, trimToSize, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IntStack()
public IntStack(int initialCapacity)
initialCapacity - the capacity of this stack.
public IntStack(int initialCapacity,
int growthFactor)
initialCapacity - the capacity of this stack.growthFactor - the factor in % for increasing the capacity
when there's not enough room in this list anymore| Method Detail |
|---|
public void push(int element)
element - the elementpublic int peek()
public int pop()
public boolean empty()
public int search(int element)
element - the element which might be on this stack
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||