- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<BaseType>
-
- org.scijava.collections.AbstractPrimitiveArray<double[],Double>
-
- org.scijava.collections.DoubleArray
-
- All Implemented Interfaces:
Iterable<Double>,Collection<Double>,List<Double>,PrimitiveArray<double[],Double>
public class DoubleArray extends AbstractPrimitiveArray<double[],Double>
An extensible array ofdoubleelements.- Author:
- Johannes Schindelin, Curtis Rueden
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Double element)booleanaddAll(int index, Collection<? extends Double> c)voidaddValue(double value)voidaddValue(int index, double value)booleancontains(double value)booleancontains(Object o)booleancontainsAll(Collection<?> c)DoubledefaultValue()Doubleget(int index)double[]getArray()Gets the fixed-size array backing this instance.doublegetValue(int index)intindexOf(double value)intindexOf(Object o)intlastIndexOf(double value)intlastIndexOf(Object o)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveValue(double value)Doubleset(int index, Double element)voidsetArray(double[] array)Sets the fixed-size array backing this instance.doublesetValue(int index, double value)-
Methods inherited from class org.scijava.collections.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.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, replaceAll, retainAll, sort, spliterator, 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:PrimitiveArrayGets the fixed-size array backing this instance.- Returns:
- the backing array
-
setArray
public void setArray(double[] array)
Description copied from interface:PrimitiveArraySets the fixed-size array backing this instance.- Parameters:
array- the new backing array
-
get
public Double get(int index)
-
add
public void add(int index, Double element)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Double>- Overrides:
lastIndexOfin classAbstractList<Double>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Double>- Specified by:
containsin interfaceList<Double>- Overrides:
containsin classAbstractCollection<Double>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Double>- Specified by:
removein interfaceList<Double>- Overrides:
removein classAbstractCollection<Double>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Double>- Specified by:
containsAllin interfaceList<Double>- Overrides:
containsAllin classAbstractCollection<Double>
-
addAll
public boolean addAll(int index, Collection<? extends Double> c)
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Double>- Specified by:
removeAllin interfaceList<Double>- Overrides:
removeAllin classAbstractCollection<Double>
-
defaultValue
public Double defaultValue()
-
-