All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.micronova.util.IXVector

java.lang.Object
   |
   +----com.micronova.util.IXVector

public abstract class IXVector
extends Object
implements Serializable
IXVector implements element-type-independent resizable array methods.

Version:
: 1.0

Variable Index

 o _count
Number of elements contained.
 o _length
Array length.

Constructor Index

 o IXVector()

Method Index

 o _allocate(int, int)
(Re-)Allocates array to given 'length' keeping given 'keepLength' elements starting at index 0.
 o _copy(int, int, int)
Copies 'length' elements from 'sourceIndex' to 'destIndex'.
 o _insertAt(int, int)
Shifts 'length' elements down at given 'index' and increases '_count'.
 o _removeAt(int, int)
Shifts 'length' elements up at given 'index' and decreases '_count'.
 o _setLength(int)
Sets the array length.
 o _shift(int, int, int)
Shifts elements at given index ('blockLength' elements at 'index' is copied to 'index + shift').
 o _unset(int, int)
Unsets (nullifies) 'length' elements starting at 'index' for garbage collection.
 o clear()
Clears all elements contained and resets _count to 0.
 o ensureCapacity(int)
Ensures that the array is at least of given length.
 o length()
Returns the array length.
 o size()
Returns number of elements contained.

Variables

 o _length
 protected int _length
Array length.

 o _count
 protected int _count
Number of elements contained. This is smaller than _length.

Constructors

 o IXVector
 public IXVector()

Methods

 o _allocate
 protected abstract void _allocate(int length,
                                   int keepLength)
(Re-)Allocates array to given 'length' keeping given 'keepLength' elements starting at index 0.

 o _copy
 protected abstract void _copy(int sourceIndex,
                               int destIndex,
                               int length)
Copies 'length' elements from 'sourceIndex' to 'destIndex'. Overlapping elements must be handled like System.arraycopy().

 o _unset
 protected abstract void _unset(int index,
                                int length)
Unsets (nullifies) 'length' elements starting at 'index' for garbage collection.

 o _setLength
 protected final void _setLength(int newLength)
Sets the array length. Calls _allocate() and then sets _length.

 o _shift
 protected final int _shift(int index,
                            int blockLength,
                            int shift)
Shifts elements at given index ('blockLength' elements at 'index' is copied to 'index + shift'). Array is expanded if necessary. 'shift' can be negative.

 o _insertAt
 protected final void _insertAt(int index,
                                int length)
Shifts 'length' elements down at given 'index' and increases '_count'. Call this before element insertion.

 o _removeAt
 protected final void _removeAt(int index,
                                int length)
Shifts 'length' elements up at given 'index' and decreases '_count'. Calls unset() for garbage collection. Call this after element removal.

 o length
 public final int length()
Returns the array length.

 o ensureCapacity
 public final void ensureCapacity(int capacity)
Ensures that the array is at least of given length. Length is doubled until it becomes big enough. If current length is 0, initial length is set to 8.

 o size
 public int size()
Returns number of elements contained.

 o clear
 public void clear()
Clears all elements contained and resets _count to 0.


All Packages  Class Hierarchy  This Package  Previous  Next  Index