org.scijava.util
Class ShortArray

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

public class ShortArray
extends AbstractPrimitiveArray<short[],Short>

An extensible array of short elements.

Author:
Johannes Schindelin, Curtis Rueden

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

ShortArray

public ShortArray()
Constructs an extensible array of shorts, backed by a fixed-size array.


ShortArray

public ShortArray(int size)
Constructs an extensible array of shorts, backed by a fixed-size array.

Parameters:
size - the initial size

ShortArray

public ShortArray(short[] array)
Constructs an extensible array of shorts, backed by the given fixed-size array.

Parameters:
array - the array to wrap
Method Detail

addValue

public void addValue(short value)

removeValue

public boolean removeValue(short value)

getValue

public short getValue(int index)

setValue

public short setValue(int index,
                      short value)

addValue

public void addValue(int index,
                     short value)

indexOf

public int indexOf(short value)

lastIndexOf

public int lastIndexOf(short value)

contains

public boolean contains(short value)

getArray

public short[] getArray()
Description copied from interface: PrimitiveArray
Gets the fixed-size array backing this instance.

Returns:
the backing array

setArray

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

Parameters:
array - the new backing array

get

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

set

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

add

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

indexOf

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

lastIndexOf

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

contains

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

remove

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

containsAll

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

addAll

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

removeAll

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

defaultValue

public Short defaultValue()


Copyright © 2009–2014 SciJava. All rights reserved.