|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.util.collection.ShortArrayList
public class ShortArrayList
ArrayList of short primitives. For just buffering values, consider
using FastShortBuffer.
| Field Summary | |
|---|---|
static int |
initialCapacity
|
| Constructor Summary | |
|---|---|
ShortArrayList()
Constructs an empty list with an initial capacity. |
|
ShortArrayList(int initialCapacity)
Constructs an empty list with the specified initial capacity. |
|
ShortArrayList(short[] data)
Constructs a list containing the elements of the specified array. |
|
| Method Summary | |
|---|---|
void |
add(int index,
short element)
Inserts the specified element at the specified position in this list. |
void |
add(short element)
Appends the specified element to the end of this list. |
void |
addAll(int index,
short[] data)
Appends all of the elements in the specified array at the specified position in this list. |
void |
addAll(short[] data)
Appends all of the elements in the specified array to the end of this list. |
void |
clear()
Removes all of the elements from this list. |
boolean |
contains(short data)
Returns true if this list contains the specified element. |
void |
ensureCapacity(int mincap)
Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument. |
short |
get(int index)
Returns the element at the specified position in this list. |
int |
indexOf(short data)
Searches for the first occurrence of the given argument. |
boolean |
isEmpty()
Tests if this list has no elements. |
int |
lastIndexOf(short data)
Returns the index of the last occurrence of the specified object in this list. |
short |
remove(int index)
Removes the element at the specified position in this list. |
void |
removeRange(int fromIndex,
int toIndex)
Removes from this list all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. |
short |
set(int index,
short element)
Replaces the element at the specified position in this list with the specified element. |
int |
size()
Returns the number of elements in this list. |
short[] |
toArray()
Returns an array containing all of the elements in this list in the correct order. |
void |
trimToSize()
Trims the capacity of this instance to be the list's current size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int initialCapacity
| Constructor Detail |
|---|
public ShortArrayList()
public ShortArrayList(int initialCapacity)
public ShortArrayList(short[] data)
| Method Detail |
|---|
public short[] toArray()
public short get(int index)
public int size()
public short remove(int index)
index - the index of the element to remove
java.lang.UnsupportedOperationException - when this operation is not
supported
java.lang.IndexOutOfBoundsException - if the specified index is out of range
public void removeRange(int fromIndex,
int toIndex)
public short set(int index,
short element)
index - the index of the element to changeelement - the value to be stored at the specified position
public void add(short element)
public void add(int index,
short element)
index - the index at which to insert the elementelement - the value to insertpublic void addAll(short[] data)
public void addAll(int index,
short[] data)
public void clear()
public boolean contains(short data)
public int indexOf(short data)
public int lastIndexOf(short data)
public boolean isEmpty()
public void ensureCapacity(int mincap)
public void trimToSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||