org.scijava.util
Class IntArray
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<BaseType>
org.scijava.util.AbstractPrimitiveArray<int[],Integer>
org.scijava.util.IntArray
- All Implemented Interfaces:
- Iterable<Integer>, Collection<Integer>, List<Integer>, PrimitiveArray<int[],Integer>, Sizable
public class IntArray
- extends AbstractPrimitiveArray<int[],Integer>
An extensible array of int elements.
- Author:
- Johannes Schindelin, Curtis Rueden
|
Constructor Summary |
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. |
| Methods inherited from class org.scijava.util.AbstractPrimitiveArray |
capacity, checkBounds, clear, copyArray, delete, ensureCapacity, getMaximumGrowth, insert, remove, setMaximumGrowth, setSize, size |
| Methods inherited from interface java.util.List |
add, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, retainAll, subList, toArray, toArray |
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
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:
PrimitiveArray
- Gets the fixed-size array backing this instance.
- Returns:
- the backing array
setArray
public void setArray(int[] array)
- Description copied from interface:
PrimitiveArray
- Sets the fixed-size array backing this instance.
- Parameters:
array - the new backing array
get
public Integer get(int index)
- Specified by:
get in interface List<Integer>- Specified by:
get in class AbstractList<Integer>
set
public Integer set(int index,
Integer element)
- Specified by:
set in interface List<Integer>- Specified by:
set in class AbstractPrimitiveArray<int[],Integer>
add
public void add(int index,
Integer element)
- Specified by:
add in interface List<Integer>- Specified by:
add in class AbstractPrimitiveArray<int[],Integer>
indexOf
public int indexOf(Object o)
- Specified by:
indexOf in interface List<Integer>- Overrides:
indexOf in class AbstractList<Integer>
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf in interface List<Integer>- Overrides:
lastIndexOf in class AbstractList<Integer>
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<Integer>- Specified by:
contains in interface List<Integer>- Overrides:
contains in class AbstractCollection<Integer>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<Integer>- Specified by:
remove in interface List<Integer>- Overrides:
remove in class AbstractCollection<Integer>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll in interface Collection<Integer>- Specified by:
containsAll in interface List<Integer>- Overrides:
containsAll in class AbstractCollection<Integer>
addAll
public boolean addAll(int index,
Collection<? extends Integer> c)
- Specified by:
addAll in interface List<Integer>- Overrides:
addAll in class AbstractList<Integer>
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll in interface Collection<Integer>- Specified by:
removeAll in interface List<Integer>- Overrides:
removeAll in class AbstractCollection<Integer>
defaultValue
public Integer defaultValue()
Copyright © 2009–2014 SciJava. All rights reserved.