public class SafeArray<T> extends Object implements ISafeArray<T>
ArrayIndexOutOfBoundsException
might accord. Notice: This
implementation is not Thread safe.Constructor and Description |
---|
SafeArray()
Constructs an empty safe array with an initial capacity of ten.
|
SafeArray(int initialCapacity)
Constructs an empty safe array with the specified initial capacity.
|
SafeArray(SafeArray<T> copy) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element)
Inserts the specified element at the specified position in this list.
|
void |
clear()
Clears the array
|
T |
get(int index)
Returns the element at the specified position in this list.
|
public SafeArray(int initialCapacity)
initialCapacity
- the initial capacity of the list.IllegalArgumentException
- if the specified initial capacity is negativepublic SafeArray()
public T get(int index)
ISafeArray
get
in interface ISafeArray<T>
index
- index of element to return.public void add(int index, T element)
ISafeArray
add
in interface ISafeArray<T>
index
- index at which the specified element is to be inserted.element
- element to be inserted.public void clear()
ISafeArray
clear
in interface ISafeArray<T>
Copyright © GigaSpaces.