- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<BaseType>
-
- org.scijava.collections.AbstractPrimitiveArray<short[],Short>
-
- org.scijava.collections.ShortArray
-
- All Implemented Interfaces:
Iterable<Short>,Collection<Short>,List<Short>,PrimitiveArray<short[],Short>
public class ShortArray extends AbstractPrimitiveArray<short[],Short>
An extensible array ofshortelements.- Author:
- Johannes Schindelin, Curtis Rueden
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Short element)booleanaddAll(int index, Collection<? extends Short> c)voidaddValue(int index, short value)voidaddValue(short value)booleancontains(short value)booleancontains(Object o)booleancontainsAll(Collection<?> c)ShortdefaultValue()Shortget(int index)short[]getArray()Gets the fixed-size array backing this instance.shortgetValue(int index)intindexOf(short value)intindexOf(Object o)intlastIndexOf(short value)intlastIndexOf(Object o)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveValue(short value)Shortset(int index, Short element)voidsetArray(short[] array)Sets the fixed-size array backing this instance.shortsetValue(int index, short 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
-
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:PrimitiveArrayGets the fixed-size array backing this instance.- Returns:
- the backing array
-
setArray
public void setArray(short[] array)
Description copied from interface:PrimitiveArraySets the fixed-size array backing this instance.- Parameters:
array- the new backing array
-
get
public Short get(int index)
-
add
public void add(int index, Short element)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Short>- Overrides:
lastIndexOfin classAbstractList<Short>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Short>- Specified by:
containsin interfaceList<Short>- Overrides:
containsin classAbstractCollection<Short>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Short>- Specified by:
removein interfaceList<Short>- Overrides:
removein classAbstractCollection<Short>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Short>- Specified by:
containsAllin interfaceList<Short>- Overrides:
containsAllin classAbstractCollection<Short>
-
addAll
public boolean addAll(int index, Collection<? extends Short> c)
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Short>- Specified by:
removeAllin interfaceList<Short>- Overrides:
removeAllin classAbstractCollection<Short>
-
defaultValue
public Short defaultValue()
-
-