|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.runtime.util.IntArrayList
public class IntArrayList
A specific array list of integer that globally works as a stack to store parser state.
Constructor Summary | |
---|---|
IntArrayList()
Creates the list with 10 as initial capacity. |
|
IntArrayList(int initialCapacity)
Creates the list with an initial capacity. |
Method Summary | |
---|---|
void |
add(int value)
Adds a value on top of the list. |
void |
clear()
Clear the whole list. |
IntArrayList |
duplicate()
Duplicates the current stack. |
int |
get(int index)
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 |
removeLast()
Removes the last value on top of the stack and returns it. |
void |
removeLast(int number)
Removes the last values on top of the stack. |
void |
set(int index,
int value)
Changes the value at index index by a new one. |
int |
size()
Returns the number of states in the stack. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IntArrayList(int initialCapacity)
initialCapacity
- the initiali capacitypublic IntArrayList()
IntArrayList(int)
Method Detail |
---|
public IntArrayList duplicate()
ReadOnlyIntStack
duplicate
in interface ReadOnlyIntStack
public void add(int value)
value
- the value to add.public void removeLast(int number)
number
- the number of values to remove.public int removeLast()
removeLast(int)
public int last()
ReadOnlyIntStack
last
in interface ReadOnlyIntStack
public void clear()
public int get(int index)
ReadOnlyIntStack
get
in interface ReadOnlyIntStack
index
- the position.
public void set(int index, int value)
add(int)
instead.
index
- value
- public int size()
ReadOnlyIntStack
size
in interface ReadOnlyIntStack
public boolean isEmpty()
ReadOnlyIntStack
isEmpty
in interface ReadOnlyIntStack
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |