org.xmloperator.lambda.tree.model
Interface TermStack


public interface TermStack

Term stack.


Method Summary
 void clear()
          Clear the content of this stack.
 boolean contains(Term term)
          Return true if the stack contains the given Term.
 int getSize()
          Returns the size of the stack.
 boolean isEmpty()
          Returns true if the stack is empty.
 Term pop()
          Returns the Term at the top and pops this stack.
 void push(Term term)
          Push a Term at the top of this stack.
 void returnToFactory()
          Returns this TermStack to the Factory.
 Term top()
          Returns the Term at the top of this stack or null if it is empty.
 

Method Detail

returnToFactory

public void returnToFactory()
Returns this TermStack to the Factory.

Post-condition: is no more usable.


getSize

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

Returns:
the size of the stack.

isEmpty

public boolean isEmpty()
Returns true if the stack is empty.

Returns:
true if the stack is empty.

clear

public void clear()
Clear the content of this stack.


contains

public boolean contains(Term term)
Return true if the stack contains the given Term.

Parameters:
term - a Term.
Returns:
true is the stack contains the given Term.

push

public void push(Term term)
Push a Term at the top of this stack.

Parameters:
term - a Term to add on top of this stack.
Throws:
java.lang.IllegalArgumentException - if the given Term is null and this stack doesn't accept null Terms.

pop

public Term pop()
Returns the Term at the top and pops this stack.

Returns:
the Term at the top and pops this stack.
Throws:
java.lang.IllegalStateException - if this stack is empty.

top

public Term top()
Returns the Term at the top of this stack or null if it is empty.

Returns:
the Term at the top of this stack or null if it is empty.