org.scijava.util
Class ShortArray
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<BaseType>
org.scijava.util.AbstractPrimitiveArray<short[],Short>
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
|
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. |
| 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 |
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
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.