T
- Object typepublic class ExtendedArray<T> extends Object implements ArrayAdapter<T,ExtendedArray<T>>
Modifier and Type | Field and Description |
---|---|
(package private) Object |
array
The array
|
(package private) T |
extra
The extra element
|
(package private) ArrayAdapter<T,Object> |
getter
The array adapter
|
(package private) int |
size
Our size
|
Modifier | Constructor and Description |
---|---|
protected |
ExtendedArray(Object array,
ArrayAdapter<T,Object> getter,
T extra)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static <T,A> ExtendedArray<T> |
extend(A array,
ArrayAdapter<T,A> getter,
T extra)
Static wrapper that has a nicer generics signature.
|
T |
get(ExtendedArray<T> array,
int off)
Get the off'th item from the array.
|
int |
size(ExtendedArray<T> array)
Get the size of the array.
|
final Object array
final ArrayAdapter<T,Object> getter
final T extra
final int size
protected ExtendedArray(Object array, ArrayAdapter<T,Object> getter, T extra)
array
- Original arraygetter
- Adapter for arrayextra
- Extra elementpublic int size(ExtendedArray<T> array)
ArrayAdapter
size
in interface ArrayAdapter<T,ExtendedArray<T>>
array
- Array-like thingpublic T get(ExtendedArray<T> array, int off) throws IndexOutOfBoundsException
ArrayAdapter
get
in interface ArrayAdapter<T,ExtendedArray<T>>
array
- Array to get fromoff
- OffsetIndexOutOfBoundsException
- for an invalid index.public static <T,A> ExtendedArray<T> extend(A array, ArrayAdapter<T,A> getter, T extra)
array
- Array to extendgetter
- Getter for arrayextra
- Extra element