BooleanCollection
, BooleanIterable
, BooleanList
, BooleanStack
, Stack<java.lang.Boolean>
, java.io.Serializable
, java.lang.Cloneable
, java.lang.Comparable<java.util.List<? extends java.lang.Boolean>>
, java.lang.Iterable<java.lang.Boolean>
, java.util.Collection<java.lang.Boolean>
, java.util.List<java.lang.Boolean>
, java.util.RandomAccess
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 | Description |
---|---|---|
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).
|
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) |
|
void |
clear() |
|
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, contains, containsAll, remove, toArray, toBooleanArray
add, add, addElements, addElements, compareTo, equals, getElements, hashCode, indexOf, lastIndexOf, peekBoolean, popBoolean, push, removeElements, set, topBoolean, toString
containsAll, toArray, toBooleanArray
forEach, forEach
add, add, contains, get, indexOf, lastIndexOf, remove, remove, set
peek, pop, push, top
public boolean getBoolean(int i)
BooleanList
getBoolean
in interface BooleanList
List.get(int)
public boolean rem(boolean k)
AbstractBooleanList
This implementation delegates to indexOf()
.
rem
in interface BooleanCollection
rem
in class AbstractBooleanList
List.remove(Object)
public boolean removeBoolean(int i)
AbstractBooleanList
This implementation always throws an UnsupportedOperationException
.
removeBoolean
in interface BooleanList
removeBoolean
in class AbstractBooleanList
List.remove(int)
public boolean contains(boolean k)
AbstractBooleanList
This implementation delegates to indexOf()
.
contains
in interface BooleanCollection
contains
in class AbstractBooleanList
List.contains(Object)
public boolean[] toBooleanArray()
BooleanCollection
toBooleanArray
in interface BooleanCollection
toBooleanArray
in class AbstractBooleanCollection
Collection.toArray()
public BooleanListIterator listIterator()
AbstractBooleanList
This implementation delegates to listIterator(0)
.
listIterator
in interface BooleanList
listIterator
in interface java.util.List<java.lang.Boolean>
listIterator
in class AbstractBooleanList
List.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 BooleanCollection
iterator
in interface BooleanIterable
iterator
in interface BooleanList
iterator
in interface java.util.Collection<java.lang.Boolean>
iterator
in interface java.lang.Iterable<java.lang.Boolean>
iterator
in interface java.util.List<java.lang.Boolean>
iterator
in class AbstractBooleanList
Iterable.iterator()
public BooleanListIterator listIterator(int i)
AbstractBooleanList
This implementation is based on the random-access methods.
listIterator
in interface BooleanList
listIterator
in interface java.util.List<java.lang.Boolean>
listIterator
in class AbstractBooleanList
List.listIterator(int)
public BooleanList subList(int from, int to)
BooleanList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in
List.subList(int,int)
.
subList
in interface BooleanList
subList
in interface java.util.List<java.lang.Boolean>
subList
in class AbstractBooleanList
List.subList(int,int)
public boolean addAll(int i, java.util.Collection<? extends java.lang.Boolean> c)
AbstractBooleanList
addAll
in interface java.util.List<java.lang.Boolean>
addAll
in class AbstractBooleanList
public 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 AbstractBooleanList
public 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 BooleanList
addAll
in class AbstractBooleanList
List.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 BooleanList
addAll
in class AbstractBooleanList
List.add(int,Object)
public boolean addAll(int i, BooleanCollection c)
BooleanList
addAll
in interface BooleanList
addAll
in class AbstractBooleanList
List.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 BooleanCollection
addAll
in class AbstractBooleanList
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean removeAll(BooleanCollection c)
BooleanCollection
removeAll
in interface BooleanCollection
removeAll
in class AbstractBooleanCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.removeAll(Collection)
public boolean retainAll(BooleanCollection c)
BooleanCollection
retainAll
in interface BooleanCollection
retainAll
in class AbstractBooleanCollection
c
- 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 BooleanList
size
in class AbstractBooleanList
size
- 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 AbstractBooleanList
public java.lang.Object clone()