- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<BaseType>
-
- org.scijava.collections.AbstractPrimitiveArray<float[],Float>
-
- org.scijava.collections.FloatArray
-
- All Implemented Interfaces:
Iterable<Float>,Collection<Float>,List<Float>,PrimitiveArray<float[],Float>
public class FloatArray extends AbstractPrimitiveArray<float[],Float>
An extensible array offloatelements.- Author:
- Johannes Schindelin, Curtis Rueden
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description FloatArray()Constructs an extensible array of floats, backed by a fixed-size array.FloatArray(float[] array)Constructs an extensible array of floats, backed by the given fixed-size array.FloatArray(int size)Constructs an extensible array of floats, backed by a fixed-size array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Float element)booleanaddAll(int index, Collection<? extends Float> c)voidaddValue(float value)voidaddValue(int index, float value)booleancontains(float value)booleancontains(Object o)booleancontainsAll(Collection<?> c)FloatdefaultValue()Floatget(int index)float[]getArray()Gets the fixed-size array backing this instance.floatgetValue(int index)intindexOf(float value)intindexOf(Object o)intlastIndexOf(float value)intlastIndexOf(Object o)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveValue(float value)Floatset(int index, Float element)voidsetArray(float[] array)Sets the fixed-size array backing this instance.floatsetValue(int index, float 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
-
FloatArray
public FloatArray()
Constructs an extensible array of floats, backed by a fixed-size array.
-
FloatArray
public FloatArray(int size)
Constructs an extensible array of floats, backed by a fixed-size array.- Parameters:
size- the initial size
-
FloatArray
public FloatArray(float[] array)
Constructs an extensible array of floats, backed by the given fixed-size array.- Parameters:
array- the array to wrap
-
-
Method Detail
-
addValue
public void addValue(float value)
-
removeValue
public boolean removeValue(float value)
-
getValue
public float getValue(int index)
-
setValue
public float setValue(int index, float value)
-
addValue
public void addValue(int index, float value)
-
indexOf
public int indexOf(float value)
-
lastIndexOf
public int lastIndexOf(float value)
-
contains
public boolean contains(float value)
-
getArray
public float[] getArray()
Description copied from interface:PrimitiveArrayGets the fixed-size array backing this instance.- Returns:
- the backing array
-
setArray
public void setArray(float[] array)
Description copied from interface:PrimitiveArraySets the fixed-size array backing this instance.- Parameters:
array- the new backing array
-
get
public Float get(int index)
-
add
public void add(int index, Float element)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Float>- Overrides:
lastIndexOfin classAbstractList<Float>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Float>- Specified by:
containsin interfaceList<Float>- Overrides:
containsin classAbstractCollection<Float>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Float>- Specified by:
removein interfaceList<Float>- Overrides:
removein classAbstractCollection<Float>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Float>- Specified by:
containsAllin interfaceList<Float>- Overrides:
containsAllin classAbstractCollection<Float>
-
addAll
public boolean addAll(int index, Collection<? extends Float> c)
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Float>- Specified by:
removeAllin interfaceList<Float>- Overrides:
removeAllin classAbstractCollection<Float>
-
defaultValue
public Float defaultValue()
-
-