public static class BooleanLists.Singleton extends AbstractBooleanList implements java.util.RandomAccess, java.io.Serializable, java.lang.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(java.util.Collection<? extends java.lang.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,
java.util.Collection<? extends java.lang.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). |
java.lang.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(java.util.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(java.util.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, addElements, addElements, compareTo, equals, getElements, hashCode, indexOf, lastIndexOf, peekBoolean, popBoolean, push, removeElements, set, topBoolean, toStringadd, contains, containsAll, remove, toArray, toBooleanArrayadd, add, contains, get, indexOf, lastIndexOf, remove, remove, setcontainsAll, isEmpty, replaceAll, sort, spliterator, toArray, toArraycontainsAll, toArray, toBooleanArrayforEach, forEachpeek, pop, push, toppublic 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 java.util.List<java.lang.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 java.lang.Iterable<java.lang.Boolean>iterator in interface java.util.Collection<java.lang.Boolean>iterator in interface java.util.List<java.lang.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 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 addAll(int i,
java.util.Collection<? extends java.lang.Boolean> c)
AbstractBooleanListaddAll in interface java.util.List<java.lang.Boolean>addAll in class AbstractBooleanListpublic boolean addAll(java.util.Collection<? extends java.lang.Boolean> c)
AbstractBooleanList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface java.util.Collection<java.lang.Boolean>addAll in interface java.util.List<java.lang.Boolean>addAll in class AbstractBooleanListpublic boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Boolean>removeAll in interface java.util.List<java.lang.Boolean>removeAll in class java.util.AbstractCollection<java.lang.Boolean>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Boolean>retainAll in interface java.util.List<java.lang.Boolean>retainAll in class java.util.AbstractCollection<java.lang.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,java.util.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 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 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 java.util.Collection<java.lang.Boolean>clear in interface java.util.List<java.lang.Boolean>clear in class AbstractBooleanListpublic java.lang.Object clone()
clone in class java.lang.Object