public static class AbstractByteList.ByteSubList extends AbstractByteList implements java.io.Serializable
AbstractByteList.ByteSubList
Constructor and Description |
---|
ByteSubList(ByteList l,
int from,
int to) |
Modifier and Type | Method and Description |
---|---|
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,
java.util.Collection<? extends java.lang.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(java.lang.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. |
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
add, byteIterator, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toByteArray, toByteArray
add, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
byteIterator, containsAll, removeAll, retainAll, toArray, toArray, toByteArray, toByteArray
public ByteSubList(ByteList l, int from, int to)
public boolean add(byte k)
add
in interface ByteCollection
add
in interface ByteList
add
in class AbstractByteList
Collection.add(Object)
public void add(int index, byte k)
add
in interface ByteList
add
in class AbstractByteList
List.add(int,Object)
public boolean addAll(int index, java.util.Collection<? extends java.lang.Byte> c)
addAll
in interface java.util.List<java.lang.Byte>
addAll
in class AbstractByteList
public byte getByte(int index)
public byte removeByte(int index)
removeByte
in interface ByteList
removeByte
in class AbstractByteList
List.remove(int)
public byte set(int index, byte k)
set
in interface ByteList
set
in class AbstractByteList
List.set(int,Object)
public void clear()
clear
in interface java.util.Collection<java.lang.Byte>
clear
in interface java.util.List<java.lang.Byte>
clear
in class java.util.AbstractCollection<java.lang.Byte>
public int size()
size
in interface java.util.Collection<java.lang.Byte>
size
in interface java.util.List<java.lang.Byte>
size
in class java.util.AbstractCollection<java.lang.Byte>
public void getElements(int from, byte[] a, int offset, int length)
AbstractByteList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements
in interface ByteList
getElements
in class AbstractByteList
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.public void removeElements(int from, int to)
AbstractByteList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface ByteList
removeElements
in class AbstractByteList
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, byte[] a, int offset, int length)
AbstractByteList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements
in interface ByteList
addElements
in class AbstractByteList
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.public ByteListIterator listIterator(int index)
ByteList
listIterator
in interface ByteList
listIterator
in interface java.util.List<java.lang.Byte>
listIterator
in class AbstractByteList
List.listIterator(int)
public ByteList subList(int from, int to)
ByteList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in List.subList(int,int)
.
subList
in interface ByteList
subList
in interface java.util.List<java.lang.Byte>
subList
in class AbstractByteList
List.subList(int,int)
public boolean rem(byte k)
ByteCollection
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()
.rem
in interface ByteCollection
rem
in class AbstractByteList
Collection.remove(Object)
public boolean remove(java.lang.Object o)
AbstractByteList
rem()
.remove
in interface java.util.Collection<java.lang.Byte>
remove
in interface java.util.List<java.lang.Byte>
remove
in class AbstractByteList
public boolean addAll(int index, ByteCollection c)
AbstractByteList
addAll
in interface ByteList
addAll
in class AbstractByteList
List.add(int,Object)
public boolean addAll(int index, ByteList l)
AbstractByteList
addAll
in interface ByteList
addAll
in class AbstractByteList
List.add(int,Object)