uk.ac.starlink.util
Class DoubleList

java.lang.Object
  extended byuk.ac.starlink.util.PrimitiveList
      extended byuk.ac.starlink.util.DoubleList

public class DoubleList
extends PrimitiveList

Extendable array of doubles.

Since:
12 Oct 2006

Constructor Summary
DoubleList()
          Constructs a new list.
DoubleList(double[] array)
          Constructs a new list initialised to the contents of a given array.
DoubleList(int size)
          Constructs a new list with a given initial capacity.
 
Method Summary
 void add(double value)
          Appends a value to the end of this list.
 double get(int i)
          Returns the element at a given position.
 void set(int i, double value)
          Sets the element at a given position.
 double[] toDoubleArray()
          Returns the contents of this list as an array.
 
Methods inherited from class uk.ac.starlink.util.PrimitiveList
size, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleList

public DoubleList()
Constructs a new list.


DoubleList

public DoubleList(int size)
Constructs a new list with a given initial capacity.

Parameters:
size - initial capacity

DoubleList

public DoubleList(double[] array)
Constructs a new list initialised to the contents of a given array.

Parameters:
array - array whose contents form initial contents of list
Method Detail

get

public double get(int i)
Returns the element at a given position.

Parameters:
i - index
Returns:
element at i

set

public void set(int i,
                double value)
Sets the element at a given position.

Parameters:
i - index
value - new value for element i

add

public void add(double value)
Appends a value to the end of this list.

Parameters:
value - value to append

toDoubleArray

public double[] toDoubleArray()
Returns the contents of this list as an array.

Returns:
copy of list contents

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.