Package org.apache.accumulo.core.util
Class PreAllocatedArray<T>
- java.lang.Object
-
- org.apache.accumulo.core.util.PreAllocatedArray<T>
-
- All Implemented Interfaces:
Iterable<T>
public class PreAllocatedArray<T> extends Object implements Iterable<T>
AnArrayList
implementation that represents a type-safe pre-allocated array. This should be used exactly like an array, but helps avoid type-safety issues when mixing arrays with generics. The iterator is unmodifiable.
-
-
Field Summary
Fields Modifier and Type Field Description int
length
-
Constructor Summary
Constructors Constructor Description PreAllocatedArray(int capacity)
Creates an instance of the given capacity, with all elements initialized to null
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get(int index)
Get the item stored at the specified index.Iterator<T>
iterator()
T
set(int index, T element)
Set the element at the specified index, and return the old value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-