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