public static class IntSortedSets.UnmodifiableSortedSet extends IntSets.UnmodifiableSet implements IntSortedSet, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(int k)
Ensures that this collection contains the specified element (optional operation).
|
boolean |
add(java.lang.Integer k)
Deprecated.
|
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.
|
void |
clear() |
IntComparator |
comparator() |
boolean |
contains(int o)
Returns
true if this collection contains the specified element. |
boolean |
contains(java.lang.Object k)
Deprecated.
|
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsAll(IntCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
java.lang.Integer |
first()
Deprecated.
Please use the corresponding type-specific method instead.
|
int |
firstInt()
Returns the first (lowest) element currently in this set.
|
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. |
IntSortedSet |
headSet(int to)
Returns a view of the portion of this sorted set whose elements are strictly less than
toElement . |
IntSortedSet |
headSet(java.lang.Integer to)
Deprecated.
Please use the corresponding type-specific method instead.
|
IntIterator |
intIterator()
Returns a primitive iterator on the elements of this collection.
|
java.util.stream.IntStream |
intParallelStream()
Return a parallel primitive stream over the elements, performing widening casts if needed.
|
IntSpliterator |
intSpliterator()
Returns a primitive spliterator on the elements of this collection.
|
java.util.stream.IntStream |
intStream()
Return a primitive stream over the elements, performing widening casts if needed.
|
boolean |
isEmpty() |
IntBidirectionalIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
IntBidirectionalIterator |
iterator(int from)
Returns a type-specific
BidirectionalIterator on the elements in
this set, starting from a given element of the domain (optional operation). |
java.lang.Integer |
last()
Deprecated.
Please use the corresponding type-specific method instead.
|
int |
lastInt()
Returns the last (highest) element currently in this set.
|
java.util.stream.Stream<java.lang.Integer> |
parallelStream()
Deprecated.
|
boolean |
remove(java.lang.Object k)
Deprecated.
|
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 |
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 collection.
|
java.util.stream.Stream<java.lang.Integer> |
stream()
Deprecated.
|
IntSortedSet |
subSet(java.lang.Integer from,
java.lang.Integer to)
Deprecated.
Please use the corresponding type-specific method instead.
|
IntSortedSet |
subSet(int from,
int to)
Returns a view of the portion of this sorted set whose elements range from
fromElement , inclusive, to toElement , exclusive. |
IntSortedSet |
tailSet(int from)
Returns a view of the portion of this sorted set whose elements are greater than or equal to
fromElement . |
IntSortedSet |
tailSet(java.lang.Integer from)
Deprecated.
Please use the corresponding type-specific method instead.
|
java.lang.Object[] |
toArray() |
int[] |
toArray(int[] 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) |
int[] |
toIntArray()
Returns a primitive type array containing the items of this collection.
|
int[] |
toIntArray(int[] a)
Deprecated.
|
java.lang.String |
toString() |
equals, hashCode, rem, remove
spliterator
add, contains, of, of, of, of, of, rem, remove, remove
add, addAll, contains, containsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toIntArray, toIntArray
forEach, forEach, forEach
public IntComparator comparator()
IntSortedSet
comparator
in interface IntSortedSet
comparator
in interface java.util.SortedSet<java.lang.Integer>
public IntSortedSet subSet(int from, int to)
IntSortedSet
fromElement
, inclusive, to toElement
, exclusive.subSet
in interface IntSortedSet
SortedSet.subSet(Object,Object)
public IntSortedSet headSet(int to)
IntSortedSet
toElement
.headSet
in interface IntSortedSet
SortedSet.headSet(Object)
public IntSortedSet tailSet(int from)
IntSortedSet
fromElement
.tailSet
in interface IntSortedSet
SortedSet.tailSet(Object)
public IntBidirectionalIterator iterator()
IntCollection
iterator
in interface IntBidirectionalIterable
iterator
in interface IntCollection
iterator
in interface IntIterable
iterator
in interface IntSet
iterator
in interface IntSortedSet
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>
Iterable.iterator()
public IntBidirectionalIterator iterator(int from)
IntSortedSet
BidirectionalIterator
on the elements in
this set, starting from a given element of the domain (optional operation).
This method returns a type-specific bidirectional iterator with given
starting point. The starting point is any element comparable to the
elements of this set (even if it does not actually belong to the
set). The next element of the returned iterator is the least element of
the set that is greater than the starting point (if there are no
elements greater than the starting point, hasNext()
will return
false
). The previous element of the returned iterator is
the greatest element of the set that is smaller than or equal to the
starting point (if there are no elements smaller than or equal to the
starting point, hasPrevious()
will return false
).
Note that passing the last element of the set as starting point and
calling previous()
you can traverse the
entire set in reverse order.
iterator
in interface IntSortedSet
from
- an element to start from.public int firstInt()
IntSortedSet
firstInt
in interface IntSortedSet
SortedSet.first()
public int lastInt()
IntSortedSet
lastInt
in interface IntSortedSet
SortedSet.last()
@Deprecated public java.lang.Integer first()
first
in interface IntSortedSet
first
in interface java.util.SortedSet<java.lang.Integer>
@Deprecated public java.lang.Integer last()
last
in interface IntSortedSet
last
in interface java.util.SortedSet<java.lang.Integer>
@Deprecated public IntSortedSet subSet(java.lang.Integer from, java.lang.Integer to)
subSet
in interface IntSortedSet
subSet
in interface java.util.SortedSet<java.lang.Integer>
@Deprecated public IntSortedSet headSet(java.lang.Integer to)
headSet
in interface IntSortedSet
headSet
in interface java.util.SortedSet<java.lang.Integer>
@Deprecated public IntSortedSet tailSet(java.lang.Integer from)
tailSet
in interface IntSortedSet
tailSet
in interface java.util.SortedSet<java.lang.Integer>
public boolean add(int k)
IntCollection
add
in interface IntCollection
Collection.add(Object)
public int size()
size
in interface java.util.Collection<java.lang.Integer>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<java.lang.Integer>
public boolean contains(int o)
IntCollection
true
if this collection contains the specified element.contains
in interface IntCollection
Collection.contains(Object)
public IntSpliterator spliterator()
IntCollection
See Collection.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface IntCollection
spliterator
in interface IntIterable
spliterator
in interface java.lang.Iterable<java.lang.Integer>
spliterator
in interface java.util.Collection<java.lang.Integer>
@Deprecated public java.util.stream.Stream<java.lang.Integer> stream()
IntCollection
stream
in interface IntCollection
stream
in interface java.util.Collection<java.lang.Integer>
@Deprecated public java.util.stream.Stream<java.lang.Integer> parallelStream()
IntCollection
parallelStream
in interface IntCollection
parallelStream
in interface java.util.Collection<java.lang.Integer>
public void clear()
clear
in interface java.util.Collection<java.lang.Integer>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<java.lang.Integer>
public java.lang.Object[] toArray()
toArray
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 containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<java.lang.Integer>
public boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
addAll
in interface java.util.Collection<java.lang.Integer>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<java.lang.Integer>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<java.lang.Integer>
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 boolean add(java.lang.Integer k)
IntCollection
add
in interface IntCollection
add
in interface java.util.Collection<java.lang.Integer>
@Deprecated public boolean contains(java.lang.Object k)
IntCollection
contains
in interface IntCollection
contains
in interface java.util.Collection<java.lang.Integer>
@Deprecated public boolean remove(java.lang.Object k)
IntCollection
remove
in interface IntCollection
remove
in interface java.util.Collection<java.lang.Integer>
public int[] toIntArray()
IntCollection
toIntArray
in interface IntCollection
Collection.toArray()
@Deprecated public int[] toIntArray(int[] a)
IntCollection
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.
toIntArray
in interface IntCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public int[] toArray(int[] a)
IntCollection
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 IntCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean containsAll(IntCollection c)
IntCollection
containsAll
in interface IntCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean addAll(IntCollection c)
IntCollection
addAll
in interface IntCollection
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
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
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
public IntIterator intIterator()
IntCollection
This method is identical to IntCollection.iterator()
, as the type-specific
iterator is already compatible with the JDK's primitive iterators.
It only exists for compatibility with the other primitive types' Collection
s
that have use for widened iterators.
intIterator
in interface IntCollection
intIterator
in interface IntIterable
public IntSpliterator intSpliterator()
IntCollection
This method is identical to IntCollection.spliterator()
, as the type-specific
spliterator is already compatible with the JDK's primitive spliterators.
It only exists for compatibility with the other primitive types' Collection
s
that have use for widened spliterators.
intSpliterator
in interface IntCollection
intSpliterator
in interface IntIterable
public java.util.stream.IntStream intStream()
IntCollection
intStream
in interface IntCollection
Collection.stream()
,
IntStream
public java.util.stream.IntStream intParallelStream()
IntCollection
intParallelStream
in interface IntCollection
Collection.parallelStream()
,
IntStream
public java.lang.String toString()
toString
in class java.lang.Object