public static class BooleanSets.SynchronizedSet extends java.lang.Object implements BooleanSet, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(boolean k)
Ensures that this collection contains the specified element (optional operation).
|
boolean |
add(java.lang.Boolean k)
Deprecated.
|
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 |
contains(java.lang.Object k)
Deprecated.
|
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. |
int |
hashCode() |
boolean |
isEmpty() |
BooleanIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
java.util.stream.Stream<java.lang.Boolean> |
parallelStream() |
boolean |
rem(boolean k)
Deprecated.
|
boolean |
remove(boolean k)
Removes an element from this set.
|
boolean |
remove(java.lang.Object k)
Deprecated.
|
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 |
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.util.stream.Stream<java.lang.Boolean> |
stream() |
java.lang.Object[] |
toArray() |
boolean[] |
toArray(boolean[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
|
<T> T[] |
toArray(T[] a) |
boolean[] |
toBooleanArray()
Returns a primitive type array containing the items of this collection.
|
boolean[] |
toBooleanArray(boolean[] a)
Deprecated.
|
java.lang.String |
toString() |
add, contains, iterator, of, of, of, of, of, remove, spliterator
add, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toBooleanArray, toBooleanArray
forEach, forEach
public boolean remove(boolean k)
BooleanSet
remove
in interface BooleanSet
Collection.remove(Object)
@Deprecated public boolean rem(boolean k)
BooleanCollection
Note that this method should be called remove()
, but the clash
with the similarly named index-based method in the List
interface
forces us to use a distinguished name. For simplicity, the set interfaces reinstates
remove()
.
rem
in interface BooleanCollection
rem
in interface BooleanSet
Collection.remove(Object)
public boolean add(boolean k)
BooleanCollection
add
in interface BooleanCollection
Collection.add(Object)
public boolean contains(boolean k)
BooleanCollection
true
if this collection contains the specified element.contains
in interface BooleanCollection
Collection.contains(Object)
public int size()
size
in interface java.util.Collection<java.lang.Boolean>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<java.lang.Boolean>
public boolean[] toBooleanArray()
BooleanCollection
toBooleanArray
in interface BooleanCollection
Collection.toArray()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Boolean>
@Deprecated public boolean[] toBooleanArray(boolean[] a)
BooleanCollection
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
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean[] toArray(boolean[] a)
BooleanCollection
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.
toArray
in interface BooleanCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean addAll(BooleanCollection c)
BooleanCollection
addAll
in interface BooleanCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean containsAll(BooleanCollection c)
BooleanCollection
containsAll
in interface BooleanCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean removeAll(BooleanCollection c)
BooleanCollection
removeAll
in interface BooleanCollection
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
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
@Deprecated public boolean add(java.lang.Boolean k)
BooleanCollection
add
in interface BooleanCollection
add
in interface java.util.Collection<java.lang.Boolean>
@Deprecated public boolean contains(java.lang.Object k)
BooleanCollection
contains
in interface BooleanCollection
contains
in interface java.util.Collection<java.lang.Boolean>
@Deprecated public boolean remove(java.lang.Object k)
BooleanCollection
remove
in interface BooleanCollection
remove
in interface java.util.Collection<java.lang.Boolean>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<java.lang.Boolean>
public BooleanIterator 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>
Iterable.iterator()
public BooleanSpliterator spliterator()
BooleanCollection
See Collection.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface BooleanCollection
spliterator
in interface BooleanIterable
spliterator
in interface java.lang.Iterable<java.lang.Boolean>
spliterator
in interface java.util.Collection<java.lang.Boolean>
public java.util.stream.Stream<java.lang.Boolean> stream()
stream
in interface java.util.Collection<java.lang.Boolean>
public java.util.stream.Stream<java.lang.Boolean> parallelStream()
parallelStream
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(java.util.Collection<? extends java.lang.Boolean> c)
addAll
in interface java.util.Collection<java.lang.Boolean>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<java.lang.Boolean>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<java.lang.Boolean>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<java.lang.Boolean>
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)
public void clear()
clear
in interface java.util.Collection<java.lang.Boolean>
public java.lang.String toString()
toString
in class java.lang.Object
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