org.xmloperator.lambda2.net.model
Interface Stack

All Known Implementing Classes:
StackImpl

public interface Stack

Stack of Object.


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.
 

Method Detail

isEmpty

public boolean isEmpty()
Returns true if this stack is empty, false elsewhere.

Returns:
true if this stack is empty, false elsewhere.

size

public int size()
Returns the size of this stack.

Returns:
the size of this stack.

get

public java.lang.Object get(int index)
Returns the object of this stack with the given index.

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)
Adds a given Object to the top of this stack.

Parameters:
object - an Object. May be null.

pop

public java.lang.Object pop()
Pops an Object at the top of the stack and returns it.

Returns:
the Object at the top of the stack. May be null.
Throws:
java.lang.IllegalStateException - if the stack is empty.