- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<BaseType>
-
- org.scijava.collections.AbstractPrimitiveArray<byte[],Byte>
-
- org.scijava.collections.ByteArray
-
- All Implemented Interfaces:
Iterable<Byte>,Collection<Byte>,List<Byte>,PrimitiveArray<byte[],Byte>
public class ByteArray extends AbstractPrimitiveArray<byte[],Byte>
An extensible array ofbyteelements.- Author:
- Johannes Schindelin, Curtis Rueden
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ByteArray()Constructs an extensible array of bytes, backed by a fixed-size array.ByteArray(byte[] array)Constructs an extensible array of bytes, backed by the given fixed-size array.ByteArray(int size)Constructs an extensible array of bytes, backed by a fixed-size array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Byte element)booleanaddAll(int index, Collection<? extends Byte> c)voidaddValue(byte value)voidaddValue(int index, byte value)booleancontains(byte value)booleancontains(Object o)booleancontainsAll(Collection<?> c)BytedefaultValue()Byteget(int index)byte[]getArray()Gets the fixed-size array backing this instance.bytegetValue(int index)intindexOf(byte value)intindexOf(Object o)intlastIndexOf(byte value)intlastIndexOf(Object o)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveValue(byte value)Byteset(int index, Byte element)voidsetArray(byte[] array)Sets the fixed-size array backing this instance.bytesetValue(int index, byte 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
-
ByteArray
public ByteArray()
Constructs an extensible array of bytes, backed by a fixed-size array.
-
ByteArray
public ByteArray(int size)
Constructs an extensible array of bytes, backed by a fixed-size array.- Parameters:
size- the initial size
-
ByteArray
public ByteArray(byte[] array)
Constructs an extensible array of bytes, backed by the given fixed-size array.- Parameters:
array- the array to wrap
-
-
Method Detail
-
addValue
public void addValue(byte value)
-
removeValue
public boolean removeValue(byte value)
-
getValue
public byte getValue(int index)
-
setValue
public byte setValue(int index, byte value)
-
addValue
public void addValue(int index, byte value)
-
indexOf
public int indexOf(byte value)
-
lastIndexOf
public int lastIndexOf(byte value)
-
contains
public boolean contains(byte value)
-
getArray
public byte[] getArray()
Description copied from interface:PrimitiveArrayGets the fixed-size array backing this instance.- Returns:
- the backing array
-
setArray
public void setArray(byte[] array)
Description copied from interface:PrimitiveArraySets the fixed-size array backing this instance.- Parameters:
array- the new backing array
-
get
public Byte get(int index)
-
add
public void add(int index, Byte element)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Byte>- Overrides:
lastIndexOfin classAbstractList<Byte>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Byte>- Specified by:
containsin interfaceList<Byte>- Overrides:
containsin classAbstractCollection<Byte>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Byte>- Specified by:
removein interfaceList<Byte>- Overrides:
removein classAbstractCollection<Byte>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Byte>- Specified by:
containsAllin interfaceList<Byte>- Overrides:
containsAllin classAbstractCollection<Byte>
-
addAll
public boolean addAll(int index, Collection<? extends Byte> c)
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Byte>- Specified by:
removeAllin interfaceList<Byte>- Overrides:
removeAllin classAbstractCollection<Byte>
-
defaultValue
public Byte defaultValue()
-
-