public static class AbstractBooleanList.BooleanSubList extends AbstractBooleanList implements java.io.Serializable
AbstractBooleanList.BooleanSubList| Modifier and Type | Field and Description |
|---|---|
protected int |
from
Initial (inclusive) index of this sublist.
|
protected BooleanList |
l
The list this sublist restricts.
|
protected int |
to
Final (exclusive) index of this sublist.
|
| Constructor and Description |
|---|
BooleanSubList(BooleanList l,
int from,
int to) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(boolean k) |
void |
add(int index,
boolean k) |
boolean |
addAll(int index,
BooleanCollection c)
Delegates to a more generic method.
|
boolean |
addAll(int index,
BooleanList l)
Delegates to a more generic method.
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Boolean> c) |
void |
addElements(int index,
boolean[] a,
int offset,
int length)
Adds elements to this type-specific list one-by-one.
|
void |
clear() |
boolean |
getBoolean(int index) |
void |
getElements(int from,
boolean[] a,
int offset,
int length)
Copies element of this type-specific list into the given array
one-by-one.
|
BooleanListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given
index.
|
boolean |
rem(boolean 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(). |
boolean |
removeBoolean(int index) |
void |
removeElements(int from,
int to)
Removes elements of this type-specific list one-by-one.
|
boolean |
set(int index,
boolean k) |
int |
size() |
BooleanList |
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, booleanListIterator, booleanListIterator, booleanSubList, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, get, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekBoolean, pop, popBoolean, push, push, remove, set, size, top, topBoolean, toStringadd, booleanIterator, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toBooleanArray, toBooleanArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArraybooleanIterator, containsAll, removeAll, retainAll, toArray, toArray, toBooleanArray, toBooleanArrayprotected final BooleanList l
protected final int from
protected int to
public BooleanSubList(BooleanList l, int from, int to)
public boolean add(boolean k)
add in interface BooleanCollectionadd in interface BooleanListadd in class AbstractBooleanListCollection.add(Object)public void add(int index,
boolean k)
add in interface BooleanListadd in class AbstractBooleanListList.add(int,Object)public boolean addAll(int index,
java.util.Collection<? extends java.lang.Boolean> c)
addAll in interface java.util.List<java.lang.Boolean>addAll in class AbstractBooleanListpublic boolean getBoolean(int index)
getBoolean in interface BooleanListList.get(int)public boolean removeBoolean(int index)
removeBoolean in interface BooleanListremoveBoolean in class AbstractBooleanListList.remove(int)public boolean set(int index,
boolean k)
set in interface BooleanListset in class AbstractBooleanListList.set(int,Object)public void clear()
clear in interface java.util.Collection<java.lang.Boolean>clear in interface java.util.List<java.lang.Boolean>clear in class java.util.AbstractCollection<java.lang.Boolean>public int size()
size in interface java.util.Collection<java.lang.Boolean>size in interface java.util.List<java.lang.Boolean>size in class java.util.AbstractCollection<java.lang.Boolean>public void getElements(int from,
boolean[] a,
int offset,
int length)
AbstractBooleanListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface BooleanListgetElements in class AbstractBooleanListfrom - 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)
AbstractBooleanListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface BooleanListremoveElements in class AbstractBooleanListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
boolean[] a,
int offset,
int length)
AbstractBooleanListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface BooleanListaddElements in class AbstractBooleanListindex - 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 BooleanListIterator listIterator(int index)
BooleanListlistIterator in interface BooleanListlistIterator in interface java.util.List<java.lang.Boolean>listIterator in class AbstractBooleanListList.listIterator(int)public BooleanList subList(int from, int to)
BooleanListfrom, inclusive, to the index to, exclusive.
Note that this specification strengthens the one given in
List.subList(int,int).
subList in interface BooleanListsubList in interface java.util.List<java.lang.Boolean>subList in class AbstractBooleanListList.subList(int,int)public boolean rem(boolean k)
BooleanCollectionremove(), 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 BooleanCollectionrem in class AbstractBooleanListCollection.remove(Object)public boolean remove(java.lang.Object o)
AbstractBooleanListrem().remove in interface java.util.Collection<java.lang.Boolean>remove in interface java.util.List<java.lang.Boolean>remove in class AbstractBooleanListpublic boolean addAll(int index,
BooleanCollection c)
AbstractBooleanListaddAll in interface BooleanListaddAll in class AbstractBooleanListList.add(int,Object)public boolean addAll(int index,
BooleanList l)
AbstractBooleanListaddAll in interface BooleanListaddAll in class AbstractBooleanListList.add(int,Object)