org.scijava.util
Class DoubleArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<BaseType>
          extended by org.scijava.util.AbstractPrimitiveArray<double[],Double>
              extended by org.scijava.util.DoubleArray
All Implemented Interfaces:
Iterable<Double>, Collection<Double>, List<Double>, PrimitiveArray<double[],Double>, Sizable

public class DoubleArray
extends AbstractPrimitiveArray<double[],Double>

An extensible array of double elements.

Author:
Johannes Schindelin, Curtis Rueden

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DoubleArray()
          Constructs an extensible array of doubles, backed by a fixed-size array.
DoubleArray(double[] array)
          Constructs an extensible array of doubles, backed by the given fixed-size array.
DoubleArray(int size)
          Constructs an extensible array of doubles, backed by a fixed-size array.
 
Method Summary
 void add(int index, Double element)
           
 boolean addAll(int index, Collection<? extends Double> c)
           
 void addValue(double value)
           
 void addValue(int index, double value)
           
 boolean contains(double value)
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 Double defaultValue()
           
 Double get(int index)
           
 double[] getArray()
          Gets the fixed-size array backing this instance.
 double getValue(int index)
           
 int indexOf(double value)
           
 int indexOf(Object o)
           
 int lastIndexOf(double value)
           
 int lastIndexOf(Object o)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean removeValue(double value)
           
 Double set(int index, Double element)
           
 void setArray(double[] array)
          Sets the fixed-size array backing this instance.
 double setValue(int index, double value)
           
 
Methods inherited from class org.scijava.util.AbstractPrimitiveArray
capacity, checkBounds, clear, copyArray, delete, ensureCapacity, getMaximumGrowth, insert, remove, setMaximumGrowth, setSize, size
 
Methods inherited from class java.util.AbstractList
add, equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, retainAll, subList, toArray, toArray
 

Constructor Detail

DoubleArray

public DoubleArray()
Constructs an extensible array of doubles, backed by a fixed-size array.


DoubleArray

public DoubleArray(int size)
Constructs an extensible array of doubles, backed by a fixed-size array.

Parameters:
size - the initial size

DoubleArray

public DoubleArray(double[] array)
Constructs an extensible array of doubles, backed by the given fixed-size array.

Parameters:
array - the array to wrap
Method Detail

addValue

public void addValue(double value)

removeValue

public boolean removeValue(double value)

getValue

public double getValue(int index)

setValue

public double setValue(int index,
                       double value)

addValue

public void addValue(int index,
                     double value)

indexOf

public int indexOf(double value)

lastIndexOf

public int lastIndexOf(double value)

contains

public boolean contains(double value)

getArray

public double[] getArray()
Description copied from interface: PrimitiveArray
Gets the fixed-size array backing this instance.

Returns:
the backing array

setArray

public void setArray(double[] array)
Description copied from interface: PrimitiveArray
Sets the fixed-size array backing this instance.

Parameters:
array - the new backing array

get

public Double get(int index)
Specified by:
get in interface List<Double>
Specified by:
get in class AbstractList<Double>

set

public Double set(int index,
                  Double element)
Specified by:
set in interface List<Double>
Specified by:
set in class AbstractPrimitiveArray<double[],Double>

add

public void add(int index,
                Double element)
Specified by:
add in interface List<Double>
Specified by:
add in class AbstractPrimitiveArray<double[],Double>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<Double>
Overrides:
indexOf in class AbstractList<Double>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<Double>
Overrides:
lastIndexOf in class AbstractList<Double>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Double>
Specified by:
contains in interface List<Double>
Overrides:
contains in class AbstractCollection<Double>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Double>
Specified by:
remove in interface List<Double>
Overrides:
remove in class AbstractCollection<Double>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Double>
Specified by:
containsAll in interface List<Double>
Overrides:
containsAll in class AbstractCollection<Double>

addAll

public boolean addAll(int index,
                      Collection<? extends Double> c)
Specified by:
addAll in interface List<Double>
Overrides:
addAll in class AbstractList<Double>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Double>
Specified by:
removeAll in interface List<Double>
Overrides:
removeAll in class AbstractCollection<Double>

defaultValue

public Double defaultValue()


Copyright © 2009–2015 SciJava. All rights reserved.