org.scijava.util
Class ByteArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<BaseType>
          extended by org.scijava.util.AbstractPrimitiveArray<byte[],Byte>
              extended by 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

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

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: 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–2015 SciJava. All rights reserved.