Package com.j_spaces.kernel
Class SafeArray<T>
java.lang.Object
com.j_spaces.kernel.SafeArray<T>
- All Implemented Interfaces:
ISafeArray<T>
Safe use "array", to use when
ArrayIndexOutOfBoundsException might accord. Notice: This
implementation is not Thread safe.- Since:
- 5.1
- Version:
- 1.0
- Author:
- Guy Korland
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SafeArray
public SafeArray(int initialCapacity) Constructs an empty safe array with the specified initial capacity.- Parameters:
initialCapacity- the initial capacity of the list.- Throws:
IllegalArgumentException- if the specified initial capacity is negative
-
SafeArray
-
SafeArray
public SafeArray()Constructs an empty safe array with an initial capacity of ten.
-
-
Method Details
-
get
Description copied from interface:ISafeArrayReturns the element at the specified position in this list.- Specified by:
getin interfaceISafeArray<T>- Parameters:
index- index of element to return.- Returns:
- the element at the specified position in this list.
-
add
Description copied from interface:ISafeArrayInserts the specified element at the specified position in this list.- Specified by:
addin interfaceISafeArray<T>- Parameters:
index- index at which the specified element is to be inserted.element- element to be inserted.
-
clear
public void clear()Description copied from interface:ISafeArrayClears the array- Specified by:
clearin interfaceISafeArray<T>
-