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

java.lang.Object
  extended by java.util.AbstractCollection<Byte>
      extended by it.unimi.dsi.fastutil.bytes.AbstractByteCollection
          extended by it.unimi.dsi.fastutil.bytes.AbstractByteList
              extended by it.unimi.dsi.fastutil.bytes.AbstractByteList.ByteSubList
All Implemented Interfaces:
ByteCollection, ByteIterable, ByteList, ByteStack, Stack<Byte>, Serializable, Comparable<List<? extends Byte>>, Iterable<Byte>, Collection<Byte>, List<Byte>
Enclosing class:
AbstractByteList

public static class AbstractByteList.ByteSubList
extends AbstractByteList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteList
AbstractByteList.ByteSubList
 
Field Summary
static long serialVersionUID
           
 
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<? extends Byte> c)
           
 void addElements(int index, byte[] a, int offset, int length)
          Adds elements to this type-specific list one-by-one.
 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.
 ByteListIterator listIterator(int index)
          Returns a type-specific list iterator on the list starting at a given index.
 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.
 boolean remove(Object o)
          Delegates to rem().
 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()
           
 ByteList subList(int from, int to)
          Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.
 
Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteList
add, addAll, addAll, addAll, addElements, byteListIterator, byteListIterator, byteSubList, compareTo, contains, equals, get, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekByte, pop, popByte, push, push, remove, set, size, top, topByte, toString
 
Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
add, byteIterator, contains, containsAll, containsAll, isEmpty, rem, 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, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection
byteIterator, containsAll, removeAll, retainAll, toArray, toArray, toByteArray, toByteArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
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
Specified by:
add in interface ByteList
Overrides:
add in class AbstractByteList
See Also:
Collection.add(Object)

add

public void add(int index,
                byte k)
Specified by:
add in interface ByteList
Overrides:
add in class AbstractByteList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int index,
                      Collection<? extends Byte> c)
Specified by:
addAll in interface List<Byte>
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
See Also:
List.remove(int)

set

public byte set(int index,
                byte k)
Specified by:
set in interface ByteList
Overrides:
set in class AbstractByteList
See Also:
List.set(int,Object)

clear

public void clear()
Specified by:
clear in interface Collection<Byte>
Specified by:
clear in interface List<Byte>
Overrides:
clear in class AbstractCollection<Byte>

size

public int size()
Specified by:
size in interface Collection<Byte>
Specified by:
size in interface List<Byte>
Specified by:
size in class AbstractCollection<Byte>

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.

listIterator

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

Specified by:
listIterator in interface ByteList
Specified by:
listIterator in interface List<Byte>
Overrides:
listIterator in class AbstractByteList
See Also:
List.listIterator(int)

subList

public ByteList subList(int from,
                        int to)
Description copied from interface: ByteList
Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.

Note that this specification strengthens the one given in List.subList(int,int).

Specified by:
subList in interface ByteList
Specified by:
subList in interface List<Byte>
Overrides:
subList in class AbstractByteList
See Also:
List.subList(int,int)

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
See Also:
Collection.remove(Object)

remove

public boolean remove(Object o)
Description copied from class: AbstractByteList
Delegates to rem().

Specified by:
remove in interface Collection<Byte>
Specified by:
remove in interface List<Byte>
Overrides:
remove 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
See Also:
List.add(int,Object)

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
See Also:
List.add(int,Object)