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