toolbox
Class NonZeroStartingArray

java.lang.Object
  extended bytoolbox.NonZeroStartingArray

public class NonZeroStartingArray
extends java.lang.Object

Resizable array of double values starting at a non-zero offset (saves memory)

Author:
Hendrik Dahlkamp

Field Summary
private  int capacityIncrement
           
private  double[] data
           
private  int elementCount
           
private  int offset
           
 
Constructor Summary
NonZeroStartingArray(int _offset)
           
NonZeroStartingArray(int _offset, int initialSize)
           
NonZeroStartingArray(int _offset, int initialSize, int _capacityIncrement)
           
 
Method Summary
 void clear()
           
 boolean contains(double value)
           
 double elementAt(int index)
           
private  void ensureCapacityHelper(int minCapacity)
           
 void setElement(int pos, double value)
           
 void setOffset(int newOffset)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private double[] data

offset

private int offset

elementCount

private int elementCount

capacityIncrement

private int capacityIncrement
Constructor Detail

NonZeroStartingArray

public NonZeroStartingArray(int _offset)

NonZeroStartingArray

public NonZeroStartingArray(int _offset,
                            int initialSize)

NonZeroStartingArray

public NonZeroStartingArray(int _offset,
                            int initialSize,
                            int _capacityIncrement)
Method Detail

setOffset

public void setOffset(int newOffset)

setElement

public void setElement(int pos,
                       double value)

elementAt

public double elementAt(int index)

ensureCapacityHelper

private void ensureCapacityHelper(int minCapacity)

contains

public boolean contains(double value)

clear

public void clear()

size

public int size()