Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

pspdash
Class DoubleList  view DoubleList download DoubleList.java

java.lang.Object
  extended bypspdash.DoubleList

public class DoubleList
extends java.lang.Object

Certain earned value calculations require frequent creation and manipulations of lists of double values. Rather than using ArrayList and allocating Double objects on the heap, this class provides a simple implementation of a list of primitive double values. This class does not attempt to provide all of the methods defined in the java.util.List interface - it only provides what is needed by the earned value logic.


Field Summary
private  double[] contents
           
private  int length
           
 
Constructor Summary
DoubleList()
          Create a new, empty double list with a default capacity.
DoubleList(int maxLen)
          Create a new, empty double list with the specified capacity.
 
Method Summary
 void add(double i)
          Add a single double value to the end of this list
 void addAll(DoubleList other)
          Add all of the double values from the other list to the end of this list
 boolean contains(double num)
          Return true if this list contains the given double value.
 void ensureCapacity(int totalCapacity)
          ensure that this list has the capacity to hold a certain number of double values, expanding the internal array structure if necessary.
 int find(double value)
          Search for a value in the list.
 double get(int pos)
          Get a single double value from this list.
 double[] getAsArray()
          Return an array containing the double values in this list.
 int size()
          Return the number of double values in this list
 void sort()
           
 java.lang.String toString()
          Return a string respresentation of this list, useful for debugging purposes only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contents

private double[] contents

length

private int length
Constructor Detail

DoubleList

public DoubleList()
Create a new, empty double list with a default capacity.


DoubleList

public DoubleList(int maxLen)
Create a new, empty double list with the specified capacity.

Method Detail

size

public int size()
Return the number of double values in this list


add

public void add(double i)
Add a single double value to the end of this list


addAll

public void addAll(DoubleList other)
Add all of the double values from the other list to the end of this list


ensureCapacity

public void ensureCapacity(int totalCapacity)
ensure that this list has the capacity to hold a certain number of double values, expanding the internal array structure if necessary.


get

public double get(int pos)
Get a single double value from this list.


sort

public void sort()

contains

public boolean contains(double num)
Return true if this list contains the given double value.


find

public int find(double value)
Search for a value in the list.


getAsArray

public double[] getAsArray()
Return an array containing the double values in this list. If this list has size 0, so will the resulting array.


toString

public java.lang.String toString()
Return a string respresentation of this list, useful for debugging purposes only.