public class ReifiedArray<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Constructor and Description |
---|
ReifiedArray(java.lang.Object originalArray) |
Modifier and Type | Method and Description |
---|---|
T |
get(int index)
Returns the element at a specified position.
|
java.lang.Class<?> |
getComponentType()
Returns the array component class type.
|
int |
getDimensions()
Returns the dimensions of the array
|
java.lang.Object |
getOriginalArray()
Returns the array used to initialize this class
|
PrimitiveArrayType |
getPrimitiveArrayType()
Returns the primitive array type for primitive arrays, or NotPrimitive for object arrays.
|
java.util.Iterator<T> |
iterator() |
int |
length()
Returns the length of the array
|
void |
set(int index,
T element)
Sets an element at a specified position.
|
public T get(int index)
java.lang.IndexOutOfBoundsException
- An index is out of bounds.java.lang.ClassCastException
- The encapsulated array is not of specified generic type, hence casting fails.public void set(int index, T element)
java.lang.IllegalArgumentException
- An illegal element was givenjava.lang.IndexOutOfBoundsException
- An index is out of bounds.public int length()
public int getDimensions()
public java.lang.Class<?> getComponentType()
public PrimitiveArrayType getPrimitiveArrayType()
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public java.lang.Object getOriginalArray()