public static class BooleanLists.Singleton extends AbstractBooleanList implements RandomAccess, Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
AbstractBooleanList.BooleanSubList| Modifier and Type | Method and Description |
|---|---|
boolean |
addAll(BooleanCollection c)
Adds all elements of the given type-specific collection to this
collection.
|
boolean |
addAll(BooleanList c)
Appends all of the elements in the specified type-specific list to the
end of this type-specific list (optional operation).
|
boolean |
addAll(Collection<? extends Boolean> c)
This implementation delegates to the type-specific version of
List.addAll(int, Collection). |
boolean |
addAll(int i,
BooleanCollection c)
Inserts all of the elements in the specified type-specific collection
into this type-specific list at the specified position (optional
operation).
|
boolean |
addAll(int i,
BooleanList c)
Inserts all of the elements in the specified type-specific list into this
type-specific list at the specified position (optional operation).
|
boolean |
addAll(int i,
Collection<? extends Boolean> c)
Adds all of the elements in the specified collection to this list
(optional operation).
|
void |
clear()
This implementation delegates to
AbstractBooleanList.removeElements(int, int). |
Object |
clone() |
boolean |
contains(boolean k)
Returns true if this list contains the specified element.
|
boolean |
getBoolean(int i)
Returns the element at the specified position in this list.
|
BooleanListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
BooleanListIterator |
listIterator()
Returns a type-specific list iterator on the list.
|
BooleanListIterator |
listIterator(int i)
Returns a type-specific list iterator on the list starting at a given
index.
|
boolean |
rem(boolean k)
Removes a single instance of the specified element from this collection,
if it is present (optional operation).
|
boolean |
removeAll(BooleanCollection c)
Remove from this collection all elements in the given type-specific
collection.
|
boolean |
removeAll(Collection<?> c) |
boolean |
removeBoolean(int i)
Removes the element at the specified position in this list (optional
operation).
|
boolean |
retainAll(BooleanCollection c)
Retains in this collection only elements from the given type-specific
collection.
|
boolean |
retainAll(Collection<?> c) |
int |
size() |
void |
size(int size)
Sets the size of this list.
|
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. |
boolean[] |
toBooleanArray()
Returns a primitive type array containing the items of this collection.
|
add, add, add, addElements, addElements, booleanListIterator, booleanListIterator, booleanSubList, compareTo, equals, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, peek, peekBoolean, pop, popBoolean, push, push, remove, removeElements, set, set, top, topBoolean, toStringadd, booleanIterator, contains, containsAll, remove, toArray, toBooleanArraycontainsAll, isEmpty, toArray, toArrayaddcontains, containsAll, isEmpty, remove, replaceAll, sort, spliterator, toArray, toArraybooleanIterator, contains, containsAll, remove, toArray, toBooleanArrayparallelStream, removeIf, streampublic boolean getBoolean(int i)
BooleanListgetBoolean in interface BooleanListList.get(int)public boolean rem(boolean k)
AbstractBooleanList
This implementation delegates to indexOf().
rem in interface BooleanCollectionrem in class AbstractBooleanListList.remove(Object)public boolean removeBoolean(int i)
AbstractBooleanList
This implementation always throws an
UnsupportedOperationException.
removeBoolean in interface BooleanListremoveBoolean in class AbstractBooleanListList.remove(int)public boolean contains(boolean k)
AbstractBooleanList
This implementation delegates to indexOf().
contains in interface BooleanCollectioncontains in class AbstractBooleanListList.contains(Object)public boolean[] toBooleanArray()
BooleanCollectiontoBooleanArray in interface BooleanCollectiontoBooleanArray in class AbstractBooleanCollectionCollection.toArray()public BooleanListIterator listIterator()
AbstractBooleanList
This implementation delegates to listIterator(0).
listIterator in interface BooleanListlistIterator in interface List<Boolean>listIterator in class AbstractBooleanListList.listIterator()public BooleanListIterator iterator()
AbstractBooleanList
Note that this specification strengthens the one given in
Iterable.iterator(), which was already strengthened in
the corresponding type-specific class, but was weakened by the fact that
this interface extends Collection.
This implementation delegates to AbstractBooleanList.listIterator().
iterator in interface BooleanCollectioniterator in interface BooleanIterableiterator in interface BooleanListiterator in interface Iterable<Boolean>iterator in interface Collection<Boolean>iterator in interface List<Boolean>iterator in class AbstractBooleanListIterable.iterator()public BooleanListIterator listIterator(int i)
AbstractBooleanListThis implementation is based on the random-access methods.
listIterator in interface BooleanListlistIterator in interface List<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 List<Boolean>subList in class AbstractBooleanListList.subList(int,int)public boolean addAll(int i,
Collection<? extends Boolean> c)
AbstractBooleanListaddAll in interface List<Boolean>addAll in class AbstractBooleanListpublic boolean addAll(Collection<? extends Boolean> c)
AbstractBooleanList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface Collection<Boolean>addAll in interface List<Boolean>addAll in class AbstractBooleanListpublic boolean removeAll(Collection<?> c)
removeAll in interface Collection<Boolean>removeAll in interface List<Boolean>removeAll in class AbstractCollection<Boolean>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<Boolean>retainAll in interface List<Boolean>retainAll in class AbstractCollection<Boolean>public boolean addAll(BooleanList c)
AbstractBooleanList
This implementation delegates to the type-specific list version of
List.addAll(int, Collection).
addAll in interface BooleanListaddAll in class AbstractBooleanListList.add(int,Object)public boolean addAll(int i,
BooleanList c)
AbstractBooleanList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface BooleanListaddAll in class AbstractBooleanListList.add(int,Object)public boolean addAll(int i,
BooleanCollection c)
BooleanListaddAll in interface BooleanListaddAll in class AbstractBooleanListList.addAll(int,Collection)public boolean addAll(BooleanCollection c)
AbstractBooleanList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface BooleanCollectionaddAll in class AbstractBooleanListc - a type-specific collection.true if this collection changed as a result of the
call.Collection.addAll(Collection)public boolean removeAll(BooleanCollection c)
BooleanCollectionremoveAll in interface BooleanCollectionremoveAll in class AbstractBooleanCollectionc - a type-specific collection.true if this collection changed as a result of the
call.Collection.removeAll(Collection)public boolean retainAll(BooleanCollection c)
BooleanCollectionretainAll in interface BooleanCollectionretainAll in class AbstractBooleanCollectionc - a type-specific collection.true if this collection changed as a result of the
call.Collection.retainAll(Collection)public int size()
size in interface Collection<Boolean>size in interface List<Boolean>size in class AbstractCollection<Boolean>public void size(int size)
BooleanList
If the specified size is smaller than the current size, the last elements
are discarded. Otherwise, they are filled with
0/null/false.
size in interface BooleanListsize in class AbstractBooleanListsize - the new size.public void clear()
AbstractBooleanList
This implementation delegates to AbstractBooleanList.removeElements(int, int).
clear in interface Collection<Boolean>clear in interface List<Boolean>clear in class AbstractBooleanList