|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.utils.IntList
public final class IntList
A simple list of primitive type int.
Constructor Summary | |
---|---|
IntList()
This is the default constructor that creates an IntList with initial length 10. |
|
IntList(int size)
This is the default constructor that creates an IntList with initial length size . |
Method Summary | |
---|---|
void |
add(int val)
Adds the element val at the end of the list. |
void |
clear()
Removes all elements from the list. |
int |
get(int index)
Returns the element with the specified index . |
int |
length()
Returns the number of inserted elements. |
int[] |
toArray()
This method returns an int array containing all elements of the list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntList()
public IntList(int size) throws IllegalArgumentException
size
.
size
- the initial size; has to be positive
IllegalArgumentException
- if the size is less than 1.Method Detail |
---|
public final void add(int val)
val
at the end of the list.
val
- the element that should be inserted.public final void clear()
public final int get(int index)
index
.
index
- the specified index
public final int length()
public final int[] toArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |