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