fr.umlv.tatoo.runtime.util
Interface ReadOnlyIntStack

All Known Implementing Classes:
IntArrayList

public interface ReadOnlyIntStack

This class is used to offer a read only view of the state stack. Each state number is encoded as an int.

Author:
Remi

Method Summary
 ReadOnlyIntStack duplicate()
          Duplicates the current stack.
 int get(int pos)
          Returns the state number at the given position.
 boolean isEmpty()
          Returns true is the number of states in the stack is zero.
 int last()
          Returns last inserted (i.e. the current) state.
 int size()
          Returns the number of states in the stack.
 

Method Detail

last

int last()
Returns last inserted (i.e. the current) state.

Returns:
the current state.

get

int get(int pos)
Returns the state number at the given position.

Parameters:
pos - the position.
Returns:
the state number.

size

int size()
Returns the number of states in the stack.

Returns:
the number of states in the stack.

isEmpty

boolean isEmpty()
Returns true is the number of states in the stack is zero.

Returns:
true if the stack is empty, false otherwise.

duplicate

ReadOnlyIntStack duplicate()
Duplicates the current stack.

Returns:
a new stack with the same states that the current one.