org.xmloperator.lambda2.net.impl
Class StackImpl

java.lang.Object
  extended byorg.xmloperator.lambda2.net.impl.StackImpl
All Implemented Interfaces:
Stack

public class StackImpl
extends java.lang.Object
implements Stack

Stack implementation.


Constructor Summary
StackImpl()
           
StackImpl(int initialCapacity)
           
 
Method Summary
 java.lang.Object get(int index)
          Returns the object of this stack with the given index.
 boolean isEmpty()
          Returns true if this stack is empty, false elsewhere.
 java.lang.Object pop()
          Pops an Object at the top of the stack and returns it.
 void push(java.lang.Object object)
          Adds a given Object to the top of this stack.
 int size()
          Returns the size of this stack.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackImpl

public StackImpl()

StackImpl

public StackImpl(int initialCapacity)
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: Stack
Returns true if this stack is empty, false elsewhere.

Specified by:
isEmpty in interface Stack
Returns:
true if this stack is empty, false elsewhere.

size

public int size()
Description copied from interface: Stack
Returns the size of this stack.

Specified by:
size in interface Stack
Returns:
the size of this stack.

get

public java.lang.Object get(int index)
Description copied from interface: Stack
Returns the object of this stack with the given index.

Specified by:
get in interface Stack
Parameters:
index - an index (from 0 at root to size - 1 at top).
Returns:
the object of this stack with the given index.

push

public void push(java.lang.Object object)
Description copied from interface: Stack
Adds a given Object to the top of this stack.

Specified by:
push in interface Stack
Parameters:
object - an Object. May be null.

pop

public java.lang.Object pop()
Description copied from interface: Stack
Pops an Object at the top of the stack and returns it.

Specified by:
pop in interface Stack
Returns:
the Object at the top of the stack. May be null.