public class PreAllocatedArray<T> extends Object implements Iterable<T>
ArrayList
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.Modifier and Type | Field and Description |
---|---|
int |
length |
Constructor and Description |
---|
PreAllocatedArray(int capacity)
Creates an instance of the given capacity, with all elements initialized to null
|
Modifier and Type | Method and 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.