- All Implemented Interfaces:
- java.lang.Iterable<java.lang.Integer>
public final class DynamicIntArray
extends java.lang.Object
implements java.lang.Iterable<java.lang.Integer>
simplistic dynamic array that differentiates from ArrayList by
- using chunks instead of exponential growth, thus efficiently dealing
with sparse arrays
- managing primitive 'int' types, i.e. not requiring box objects
the motivation for this class is memory optimization, i.e. space efficient
storage of potentially huge arrays without good a-priori size guesses
the API of this class is between a primitive array and a AbstractList. It's
not a Collection implementation because it handles primitive types, but the
API could be extended to support iterators and the like.
NOTE: like standard Collection implementations/arrays, this class is not
synchronized