public class IntList extends PrimitiveList
| Constructor | Description |
|---|---|
IntList() |
Constructs a new list.
|
IntList(int size) |
Constructs a new list with a given initial capacity.
|
IntList(int[] array) |
Constructs a new list initialised to the contents of a given array.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(int value) |
Appends a value to the end of this list.
|
int |
get(int i) |
Returns the element at a given position.
|
void |
set(int i,
int value) |
Sets the element at a given position.
|
int[] |
toIntArray() |
Returns the contents of this list as an array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnextCapacity, size, toArraypublic IntList()
public IntList(int size)
size - initial capacitypublic IntList(int[] array)
array - array whose contents form initial contents of listpublic int get(int i)
i - indexipublic void set(int i,
int value)
i - indexvalue - new value for element ipublic void add(int value)
value - value to appendpublic int[] toIntArray()
Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.