org.basex.util.list
Class ByteList

java.lang.Object
  extended by org.basex.util.list.ElementList
      extended by org.basex.util.list.ByteList

public class ByteList
extends ElementList

This is a simple container for byte values.

Author:
BaseX Team 2005-13, BSD License, Christian Gruen

Field Summary
protected  byte[] list
          Element container.
 
Fields inherited from class org.basex.util.list.ElementList
factor, size
 
Constructor Summary
ByteList()
          Default constructor.
ByteList(int capacity)
          Constructor, specifying an initial internal array size.
 
Method Summary
 ByteList add(byte[] elements)
          Adds elements to the container.
 ByteList add(byte[] elements, int start, int end)
          Adds a part of the specified elements to the container.
 ByteList add(int element)
          Adds an element to the array.
 byte get(int index)
          Returns the element at the specified index position.
 byte[] toArray()
          Returns an array with all elements.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.util.list.ElementList
isEmpty, newSize, newSize, reset, size, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected byte[] list
Element container.

Constructor Detail

ByteList

public ByteList()
Default constructor.


ByteList

public ByteList(int capacity)
Constructor, specifying an initial internal array size.

Parameters:
capacity - initial array capacity
Method Detail

add

public ByteList add(int element)
Adds an element to the array.

Parameters:
element - element to be added; will be cast to a byte
Returns:
self reference

add

public ByteList add(byte[] elements)
Adds elements to the container.

Parameters:
elements - elements to be added
Returns:
self reference

add

public ByteList add(byte[] elements,
                    int start,
                    int end)
Adds a part of the specified elements to the container.

Parameters:
elements - elements to be added
start - start position
end - end position
Returns:
self reference

get

public final byte get(int index)
Returns the element at the specified index position.

Parameters:
index - index of the element to return
Returns:
element

toArray

public byte[] toArray()
Returns an array with all elements.

Returns:
array

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object