org.scijava.util
Class BoolArray

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

public class BoolArray
extends AbstractPrimitiveArray<boolean[],Boolean>

An extensible array of boolean elements.

Author:
Mark Hiner, Johannes Schindelin, Curtis Rueden

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
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
 void add(int index, Boolean element)
           
 boolean addAll(int index, Collection<? extends Boolean> c)
           
 void addValue(boolean value)
           
 void addValue(int index, boolean value)
           
 boolean contains(boolean value)
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 Boolean defaultValue()
           
 Boolean get(int index)
           
 boolean[] getArray()
          Gets the fixed-size array backing this instance.
 boolean getValue(int index)
           
 int indexOf(boolean value)
           
 int indexOf(Object o)
           
 int lastIndexOf(boolean value)
           
 int lastIndexOf(Object o)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean removeValue(boolean value)
           
 Boolean set(int index, Boolean element)
           
 void setArray(boolean[] array)
          Sets the fixed-size array backing this instance.
 boolean setValue(int index, boolean 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

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: PrimitiveArray
Gets the fixed-size array backing this instance.

Returns:
the backing array

setArray

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

Parameters:
array - the new backing array

get

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

set

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

add

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

indexOf

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

lastIndexOf

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

contains

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

remove

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

containsAll

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

addAll

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

removeAll

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

defaultValue

public Boolean defaultValue()


Copyright © 2009–2014 SciJava. All rights reserved.