public static class BooleanSets.Singleton extends AbstractBooleanSet implements java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific set.
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) |
java.lang.Object |
clone() |
boolean |
contains(boolean k)
Returns
true if this collection contains the specified element. |
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.
|
BooleanListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(boolean k)
Removes an element from this set.
|
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 set.
|
java.lang.Object[] |
toArray()
Deprecated.
|
boolean[] |
toBooleanArray()
Returns a primitive type array containing the items of this collection.
|
equals, hashCode, rem
add, add, contains, containsAll, containsAll, remove, toArray, toBooleanArray, toString
add, contains, of, of, of, of, of, remove
add, containsAll, toArray, toBooleanArray
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 boolean remove(boolean k)
AbstractBooleanSet
rem()
method
implemented by type-specific abstract Collection
superclass.remove
in interface BooleanSet
remove
in class AbstractBooleanSet
Collection.remove(Object)
public BooleanListIterator iterator()
BooleanCollection
iterator
in interface BooleanCollection
iterator
in interface BooleanIterable
iterator
in interface BooleanSet
iterator
in interface java.lang.Iterable<java.lang.Boolean>
iterator
in interface java.util.Collection<java.lang.Boolean>
iterator
in interface java.util.Set<java.lang.Boolean>
iterator
in class AbstractBooleanSet
Iterable.iterator()
public BooleanSpliterator spliterator()
BooleanSet
Set spliterators must report at least Spliterator.DISTINCT
.
See Set.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface BooleanCollection
spliterator
in interface BooleanIterable
spliterator
in interface BooleanSet
spliterator
in interface java.lang.Iterable<java.lang.Boolean>
spliterator
in interface java.util.Collection<java.lang.Boolean>
spliterator
in interface java.util.Set<java.lang.Boolean>
public int size()
size
in interface java.util.Collection<java.lang.Boolean>
size
in interface java.util.Set<java.lang.Boolean>
size
in class java.util.AbstractCollection<java.lang.Boolean>
public boolean[] toBooleanArray()
BooleanCollection
toBooleanArray
in interface BooleanCollection
toBooleanArray
in class AbstractBooleanCollection
Collection.toArray()
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Boolean> action)
BooleanIterable
forEach
in interface BooleanIterable
forEach
in interface java.lang.Iterable<java.lang.Boolean>
public boolean addAll(java.util.Collection<? extends java.lang.Boolean> c)
AbstractBooleanCollection
addAll
in interface java.util.Collection<java.lang.Boolean>
addAll
in interface java.util.Set<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 interface java.util.Set<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 interface java.util.Set<java.lang.Boolean>
retainAll
in class AbstractBooleanCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Boolean> filter)
BooleanCollection
removeIf
in interface BooleanCollection
removeIf
in interface java.util.Collection<java.lang.Boolean>
public void forEach(BooleanConsumer action)
BooleanIterable
Iterable
until all elements have been processed or the action throws an
exception.forEach
in interface BooleanIterable
action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
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
removeIf
in interface BooleanCollection
filter
- a predicate which returns true
for elements to be
removed.true
if any elements were removed.Collection.removeIf(java.util.function.Predicate)
@Deprecated public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Boolean>
toArray
in interface java.util.Set<java.lang.Boolean>
toArray
in class java.util.AbstractCollection<java.lang.Boolean>
public java.lang.Object clone()
clone
in class java.lang.Object