it.unimi.dsi.fastutil.bytes
Class AbstractByteList.ByteSubList

java.lang.Object
  extended byit.unimi.dsi.fastutil.bytes.AbstractByteCollection
      extended byit.unimi.dsi.fastutil.bytes.AbstractByteList
          extended byit.unimi.dsi.fastutil.bytes.AbstractByteList.ByteSubList
All Implemented Interfaces:
ByteCollection, ByteList, ByteStack, Collection, Comparable, List, Serializable, Stack
Enclosing class:
AbstractByteList

public static class AbstractByteList.ByteSubList
extends AbstractByteList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteList
AbstractByteList.ByteSubList
 
Constructor Summary
AbstractByteList.ByteSubList(ByteList l, int from, int to)
           
 
Method Summary
 boolean add(byte k)
           
 void add(int index, byte k)
           
 boolean addAll(int index, ByteCollection c)
          Delegates to a more generic method.
 boolean addAll(int index, ByteList l)
          Delegates to a more generic method.
 boolean addAll(int index, Collection c)
           
 void addElements(int index, byte[] a, int offset, int length)
          Adds elements to this type-specific list one-by-one.
 ByteListIterator byteListIterator(int index)
          Returns a type-specific list iterator on the list starting at a given index.
 ByteList byteSubList(int from, int to)
           
 void clear()
           
 byte getByte(int index)
           
 void getElements(int from, byte[] a, int offset, int length)
          Copies element of this type-specific list into the given array one-by-one.
 boolean rem(byte k)
          Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name.
 byte removeByte(int index)
           
 void removeElements(int from, int to)
          Removes elements of this type-specific list one-by-one.
 byte set(int index, byte k)
           
 int size()
           
 
Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteList
add, addAll, addAll, addAll, addElements, byteIterator, byteListIterator, compareTo, contains, equals, get, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekByte, pop, popByte, push, push, remove, set, size, subList, top, topByte, toString
 
Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toByteArray, toByteArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection
containsAll, removeAll, retainAll, toArray, toByteArray, toByteArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Constructor Detail

AbstractByteList.ByteSubList

public AbstractByteList.ByteSubList(ByteList l,
                                    int from,
                                    int to)
Method Detail

add

public boolean add(byte k)
Specified by:
add in interface ByteCollection
Overrides:
add in class AbstractByteList

add

public void add(int index,
                byte k)
Specified by:
add in interface ByteList
Overrides:
add in class AbstractByteList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List
Overrides:
addAll in class AbstractByteList

addAll

public boolean addAll(int index,
                      ByteCollection c)
Description copied from class: AbstractByteList
Delegates to a more generic method.

Specified by:
addAll in interface ByteList
Overrides:
addAll in class AbstractByteList

addAll

public boolean addAll(int index,
                      ByteList l)
Description copied from class: AbstractByteList
Delegates to a more generic method.

Specified by:
addAll in interface ByteList
Overrides:
addAll in class AbstractByteList

getByte

public byte getByte(int index)
Specified by:
getByte in interface ByteList
See Also:
List.get(int)

removeByte

public byte removeByte(int index)
Specified by:
removeByte in interface ByteList
Overrides:
removeByte in class AbstractByteList

rem

public boolean rem(byte k)
Description copied from interface: ByteCollection
Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name. For simplicity, the set interfaces reinstates remove().

Specified by:
rem in interface ByteCollection
Overrides:
rem in class AbstractByteList

set

public byte set(int index,
                byte k)
Specified by:
set in interface ByteList
Overrides:
set in class AbstractByteList

clear

public void clear()
Specified by:
clear in interface List
Overrides:
clear in class AbstractByteCollection

size

public int size()
Specified by:
size in interface List

getElements

public void getElements(int from,
                        byte[] a,
                        int offset,
                        int length)
Description copied from class: AbstractByteList
Copies element of this type-specific list into the given array one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
getElements in interface ByteList
Overrides:
getElements in class AbstractByteList
Parameters:
from - the start index (inclusive).
a - the destination array.
offset - the offset into the destination array where to store the first element copied.
length - the number of elements to be copied.

removeElements

public void removeElements(int from,
                           int to)
Description copied from class: AbstractByteList
Removes elements of this type-specific list one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
removeElements in interface ByteList
Overrides:
removeElements in class AbstractByteList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

addElements

public void addElements(int index,
                        byte[] a,
                        int offset,
                        int length)
Description copied from class: AbstractByteList
Adds elements to this type-specific list one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
addElements in interface ByteList
Overrides:
addElements in class AbstractByteList
Parameters:
index - the index at which to add elements.
a - the array containing the elements.
offset - the offset of the first element to add.
length - the number of elements to add.

byteListIterator

public ByteListIterator byteListIterator(int index)
Description copied from interface: ByteList
Returns a type-specific list iterator on the list starting at a given index.

The iterator returned by the List.listIterator() method and by this method are identical; however, using this method you can save a type casting.

Specified by:
byteListIterator in interface ByteList
Overrides:
byteListIterator in class AbstractByteList

byteSubList

public ByteList byteSubList(int from,
                            int to)
Specified by:
byteSubList in interface ByteList
Overrides:
byteSubList in class AbstractByteList