public abstract static class BooleanCollections.EmptyCollection extends AbstractBooleanCollection
This class may be useful to implement your own in case you subclass a type-specific collection.
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(BooleanCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(java.util.Collection<? extends java.lang.Boolean> c) |
void |
clear() |
boolean |
contains(boolean k)
Returns
true if this collection contains the specified element. |
boolean |
containsAll(BooleanCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
equals(java.lang.Object o) |
void |
forEach(BooleanConsumer action)
Performs the given action for each element of this type-specific
Iterable
until all elements have been processed or the action throws an
exception. |
void |
forEach(java.util.function.Consumer<? super java.lang.Boolean> action)
Deprecated.
|
int |
hashCode() |
BooleanBidirectionalIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
removeAll(BooleanCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeIf(BooleanPredicate filter)
Remove from this collection all elements which satisfy the given predicate.
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Boolean> filter)
Deprecated.
|
boolean |
retainAll(BooleanCollection c)
Retains in this collection only elements from the given type-specific collection.
|
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
BooleanSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this collection.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
boolean[] |
toBooleanArray()
Returns a primitive type array containing the items of this collection.
|
boolean[] |
toBooleanArray(boolean[] a)
Deprecated.
|
public boolean contains(boolean k)
AbstractBooleanCollection
true
if this collection contains the specified element.contains
in interface BooleanCollection
contains
in class AbstractBooleanCollection
Collection.contains(Object)
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Boolean>
toArray
in class java.util.AbstractCollection<java.lang.Boolean>
public <T> T[] toArray(T[] array)
toArray
in interface java.util.Collection<java.lang.Boolean>
toArray
in class java.util.AbstractCollection<java.lang.Boolean>
public BooleanBidirectionalIterator iterator()
BooleanCollection
iterator
in interface BooleanCollection
iterator
in interface BooleanIterable
iterator
in interface java.lang.Iterable<java.lang.Boolean>
iterator
in interface java.util.Collection<java.lang.Boolean>
iterator
in class AbstractBooleanCollection
Iterable.iterator()
public BooleanSpliterator spliterator()
BooleanCollection
See Collection.spliterator()
for more documentation on the requirements
of the returned spliterator.
public int size()
size
in interface java.util.Collection<java.lang.Boolean>
size
in class java.util.AbstractCollection<java.lang.Boolean>
public void clear()
clear
in interface java.util.Collection<java.lang.Boolean>
clear
in class java.util.AbstractCollection<java.lang.Boolean>
public int hashCode()
hashCode
in interface java.util.Collection<java.lang.Boolean>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<java.lang.Boolean>
equals
in class java.lang.Object
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Boolean> action)
BooleanIterable
public boolean containsAll(java.util.Collection<?> c)
AbstractBooleanCollection
containsAll
in interface java.util.Collection<java.lang.Boolean>
containsAll
in class AbstractBooleanCollection
public boolean addAll(java.util.Collection<? extends java.lang.Boolean> c)
AbstractBooleanCollection
addAll
in interface java.util.Collection<java.lang.Boolean>
addAll
in class AbstractBooleanCollection
public boolean removeAll(java.util.Collection<?> c)
AbstractBooleanCollection
removeAll
in interface java.util.Collection<java.lang.Boolean>
removeAll
in class AbstractBooleanCollection
public boolean retainAll(java.util.Collection<?> c)
AbstractBooleanCollection
retainAll
in interface java.util.Collection<java.lang.Boolean>
retainAll
in class AbstractBooleanCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Boolean> filter)
BooleanCollection
public boolean[] toBooleanArray()
BooleanCollection
toBooleanArray
in interface BooleanCollection
toBooleanArray
in class AbstractBooleanCollection
Collection.toArray()
@Deprecated public boolean[] toBooleanArray(boolean[] a)
AbstractBooleanCollection
Note that, contrarily to Collection.toArray(Object[])
, this
methods just writes all elements of this collection: no special
value will be added after the last one.
toBooleanArray
in interface BooleanCollection
toBooleanArray
in class AbstractBooleanCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public void forEach(BooleanConsumer action)
BooleanIterable
Iterable
until all elements have been processed or the action throws an
exception.action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
public boolean containsAll(BooleanCollection c)
BooleanCollection
containsAll
in interface BooleanCollection
containsAll
in class AbstractBooleanCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean addAll(BooleanCollection c)
BooleanCollection
addAll
in interface BooleanCollection
addAll
in class AbstractBooleanCollection
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 boolean removeIf(BooleanPredicate filter)
BooleanCollection
filter
- a predicate which returns true
for elements to be
removed.true
if any elements were removed.Collection.removeIf(java.util.function.Predicate)