org.scijava.util
Class ByteArray
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<BaseType>
org.scijava.util.AbstractPrimitiveArray<byte[],Byte>
org.scijava.util.ByteArray
- All Implemented Interfaces:
- Iterable<Byte>, Collection<Byte>, List<Byte>, PrimitiveArray<byte[],Byte>, Sizable
public class ByteArray
- extends AbstractPrimitiveArray<byte[],Byte>
An extensible array of byte
elements.
- Author:
- Johannes Schindelin, Curtis Rueden
Constructor Summary |
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. |
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 |
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
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:
PrimitiveArray
- Gets the fixed-size array backing this instance.
- Returns:
- the backing array
setArray
public void setArray(byte[] array)
- Description copied from interface:
PrimitiveArray
- Sets the fixed-size array backing this instance.
- Parameters:
array
- the new backing array
get
public Byte get(int index)
- Specified by:
get
in interface List<Byte>
- Specified by:
get
in class AbstractList<Byte>
set
public Byte set(int index,
Byte element)
- Specified by:
set
in interface List<Byte>
- Specified by:
set
in class AbstractPrimitiveArray<byte[],Byte>
add
public void add(int index,
Byte element)
- Specified by:
add
in interface List<Byte>
- Specified by:
add
in class AbstractPrimitiveArray<byte[],Byte>
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interface List<Byte>
- Overrides:
indexOf
in class AbstractList<Byte>
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interface List<Byte>
- Overrides:
lastIndexOf
in class AbstractList<Byte>
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection<Byte>
- Specified by:
contains
in interface List<Byte>
- Overrides:
contains
in class AbstractCollection<Byte>
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection<Byte>
- Specified by:
remove
in interface List<Byte>
- Overrides:
remove
in class AbstractCollection<Byte>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interface Collection<Byte>
- Specified by:
containsAll
in interface List<Byte>
- Overrides:
containsAll
in class AbstractCollection<Byte>
addAll
public boolean addAll(int index,
Collection<? extends Byte> c)
- Specified by:
addAll
in interface List<Byte>
- Overrides:
addAll
in class AbstractList<Byte>
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interface Collection<Byte>
- Specified by:
removeAll
in interface List<Byte>
- Overrides:
removeAll
in class AbstractCollection<Byte>
defaultValue
public Byte defaultValue()
Copyright © 2009–2014 SciJava. All rights reserved.