org.scijava.util
Class IntArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<BaseType>
          extended by org.scijava.util.AbstractPrimitiveArray<int[],Integer>
              extended by 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

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

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: 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.