edu.tum.cs.commons.collections
Class ManagedIntArray
java.lang.Object
edu.tum.cs.commons.collections.ManagedIntArray
- Direct Known Subclasses:
- IntList, UnionFind
public class ManagedIntArray
- extends java.lang.Object
A class containing an int array that is managed in the sense that it can grow
dynamically (using exponential growth). It is useful for cases where an
ArrayList seems like overkill due to the high memory footprint of
the Integer objects and the amount of work performed for auto (un)boxing.
Note however, that a subclass has full access to the internals and thus might
cause chaos.
- Version:
- $Rev: 26283 $
- Author:
- hummelb, $Author: juergens $
- Rating:
- GREEN Hash: 88A19EE6A6126AC7747DC3EC47C17C1D
Field Summary |
protected int[] |
array
The actual array. |
protected int |
size
The current size of the array. |
Method Summary |
protected void |
addArrayElement()
Add space for a single element to the end of the array. |
protected void |
addArrayElements(int count)
Add space for multiple elements to the end of the array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
size
protected int size
- The current size of the array.
array
protected int[] array
- The actual array.
ManagedIntArray
public ManagedIntArray()
addArrayElement
protected void addArrayElement()
- Add space for a single element to the end of the array.
addArrayElements
protected void addArrayElements(int count)
- Add space for multiple elements to the end of the array.
TUM CCSM Commons - 2.7