public static class IntSets.Singleton extends AbstractIntSet 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(java.util.Collection<? extends java.lang.Integer> c) |
boolean |
addAll(IntCollection c)
Adds all elements of the given type-specific collection to this collection.
|
java.lang.Object |
clone() |
boolean |
contains(int k)
Returns
true if this collection contains the specified element. |
void |
forEach(java.util.function.Consumer<? super java.lang.Integer> action)
Deprecated.
|
void |
forEach(java.util.function.IntConsumer 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. |
IntListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(int k)
Removes an element from this set.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeAll(IntCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
removeIf(java.util.function.IntPredicate filter)
Remove from this collection all elements which satisfy the given predicate.
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Integer> filter)
Deprecated.
|
boolean |
retainAll(java.util.Collection<?> c) |
boolean |
retainAll(IntCollection c)
Retains in this collection only elements from the given type-specific collection.
|
int |
size() |
IntSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this set.
|
java.lang.Object[] |
toArray()
Deprecated.
|
int[] |
toIntArray()
Returns a primitive type array containing the items of this collection.
|
equals, hashCode, rem
add, add, contains, containsAll, containsAll, forEach, remove, removeIf, toArray, toIntArray, toString
add, contains, of, of, of, of, of, remove
add, containsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, removeIf, stream, toArray, toIntArray
forEach
public boolean contains(int k)
AbstractIntCollection
true
if this collection contains the specified element.contains
in interface IntCollection
contains
in class AbstractIntCollection
Collection.contains(Object)
public boolean remove(int k)
AbstractIntSet
rem()
method
implemented by type-specific abstract Collection
superclass.remove
in interface IntSet
remove
in class AbstractIntSet
Collection.remove(Object)
public IntListIterator iterator()
IntCollection
iterator
in interface IntCollection
iterator
in interface IntIterable
iterator
in interface IntSet
iterator
in interface java.lang.Iterable<java.lang.Integer>
iterator
in interface java.util.Collection<java.lang.Integer>
iterator
in interface java.util.Set<java.lang.Integer>
iterator
in class AbstractIntSet
Iterable.iterator()
public IntSpliterator spliterator()
IntSet
Set spliterators must report at least Spliterator.DISTINCT
.
See Set.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface IntCollection
spliterator
in interface IntIterable
spliterator
in interface IntSet
spliterator
in interface java.lang.Iterable<java.lang.Integer>
spliterator
in interface java.util.Collection<java.lang.Integer>
spliterator
in interface java.util.Set<java.lang.Integer>
public int size()
size
in interface java.util.Collection<java.lang.Integer>
size
in interface java.util.Set<java.lang.Integer>
size
in class java.util.AbstractCollection<java.lang.Integer>
public int[] toIntArray()
IntCollection
toIntArray
in interface IntCollection
toIntArray
in class AbstractIntCollection
Collection.toArray()
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Integer> action)
IntIterable
forEach
in interface IntIterable
forEach
in interface java.lang.Iterable<java.lang.Integer>
public boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
AbstractIntCollection
addAll
in interface java.util.Collection<java.lang.Integer>
addAll
in interface java.util.Set<java.lang.Integer>
addAll
in class AbstractIntCollection
public boolean removeAll(java.util.Collection<?> c)
AbstractIntCollection
removeAll
in interface java.util.Collection<java.lang.Integer>
removeAll
in interface java.util.Set<java.lang.Integer>
removeAll
in class AbstractIntCollection
public boolean retainAll(java.util.Collection<?> c)
AbstractIntCollection
retainAll
in interface java.util.Collection<java.lang.Integer>
retainAll
in interface java.util.Set<java.lang.Integer>
retainAll
in class AbstractIntCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Integer> filter)
IntCollection
removeIf
in interface IntCollection
removeIf
in interface java.util.Collection<java.lang.Integer>
public void forEach(java.util.function.IntConsumer action)
IntIterable
Iterable
until all elements have been processed or the action throws an
exception.forEach
in interface IntIterable
action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
public boolean addAll(IntCollection c)
IntCollection
addAll
in interface IntCollection
addAll
in class AbstractIntCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean removeAll(IntCollection c)
IntCollection
removeAll
in interface IntCollection
removeAll
in class AbstractIntCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.removeAll(Collection)
public boolean retainAll(IntCollection c)
IntCollection
retainAll
in interface IntCollection
retainAll
in class AbstractIntCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
public boolean removeIf(java.util.function.IntPredicate filter)
IntCollection
removeIf
in interface IntCollection
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.Integer>
toArray
in interface java.util.Set<java.lang.Integer>
toArray
in class java.util.AbstractCollection<java.lang.Integer>
public java.lang.Object clone()
clone
in class java.lang.Object