public static class CharSortedSets.UnmodifiableSortedSet extends CharSets.UnmodifiableSet implements CharSortedSet, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(char k)
Ensures that this collection contains the specified element (optional operation).
|
boolean |
add(java.lang.Character k)
Deprecated.
|
boolean |
addAll(CharCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(java.util.Collection<? extends java.lang.Character> c) |
void |
clear() |
CharComparator |
comparator() |
boolean |
contains(char o)
Returns
true if this collection contains the specified element. |
boolean |
contains(java.lang.Object k)
Deprecated.
|
boolean |
containsAll(CharCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
boolean |
containsAll(java.util.Collection<?> c) |
java.lang.Character |
first()
Deprecated.
Please use the corresponding type-specific method instead.
|
char |
firstChar()
Returns the first (lowest) element currently in this set.
|
void |
forEach(CharConsumer 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. |
CharSortedSet |
headSet(char to)
Returns a view of the portion of this sorted set whose elements are strictly less than
toElement . |
CharSortedSet |
headSet(java.lang.Character to)
Deprecated.
Please use the corresponding type-specific method instead.
|
IntIterator |
intIterator()
Returns a widened 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 widened 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() |
CharBidirectionalIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
CharBidirectionalIterator |
iterator(char from)
Returns a type-specific
BidirectionalIterator on the elements in
this set, starting from a given element of the domain (optional operation). |
java.lang.Character |
last()
Deprecated.
Please use the corresponding type-specific method instead.
|
char |
lastChar()
Returns the last (highest) element currently in this set.
|
java.util.stream.Stream<java.lang.Character> |
parallelStream()
Deprecated.
|
boolean |
remove(java.lang.Object k)
Deprecated.
|
boolean |
removeAll(CharCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeIf(CharPredicate filter)
Remove from this collection all elements which satisfy the given predicate.
|
boolean |
retainAll(CharCollection c)
Retains in this collection only elements from the given type-specific collection.
|
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
CharSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this collection.
|
java.util.stream.Stream<java.lang.Character> |
stream()
Deprecated.
|
CharSortedSet |
subSet(java.lang.Character from,
java.lang.Character to)
Deprecated.
Please use the corresponding type-specific method instead.
|
CharSortedSet |
subSet(char from,
char to)
Returns a view of the portion of this sorted set whose elements range from
fromElement , inclusive, to toElement , exclusive. |
CharSortedSet |
tailSet(char from)
Returns a view of the portion of this sorted set whose elements are greater than or equal to
fromElement . |
CharSortedSet |
tailSet(java.lang.Character from)
Deprecated.
Please use the corresponding type-specific method instead.
|
java.lang.Object[] |
toArray() |
char[] |
toArray(char[] 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) |
char[] |
toCharArray()
Returns a primitive type array containing the items of this collection.
|
char[] |
toCharArray(char[] 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, toCharArray, toCharArray
forEach, forEach, forEach
public CharComparator comparator()
CharSortedSet
comparator
in interface CharSortedSet
comparator
in interface java.util.SortedSet<java.lang.Character>
public CharSortedSet subSet(char from, char to)
CharSortedSet
fromElement
, inclusive, to toElement
, exclusive.subSet
in interface CharSortedSet
SortedSet.subSet(Object,Object)
public CharSortedSet headSet(char to)
CharSortedSet
toElement
.headSet
in interface CharSortedSet
SortedSet.headSet(Object)
public CharSortedSet tailSet(char from)
CharSortedSet
fromElement
.tailSet
in interface CharSortedSet
SortedSet.tailSet(Object)
public CharBidirectionalIterator iterator()
CharCollection
iterator
in interface CharBidirectionalIterable
iterator
in interface CharCollection
iterator
in interface CharIterable
iterator
in interface CharSet
iterator
in interface CharSortedSet
iterator
in interface java.lang.Iterable<java.lang.Character>
iterator
in interface java.util.Collection<java.lang.Character>
iterator
in interface java.util.Set<java.lang.Character>
Iterable.iterator()
public CharBidirectionalIterator iterator(char from)
CharSortedSet
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 CharSortedSet
from
- an element to start from.public char firstChar()
CharSortedSet
firstChar
in interface CharSortedSet
SortedSet.first()
public char lastChar()
CharSortedSet
lastChar
in interface CharSortedSet
SortedSet.last()
@Deprecated public java.lang.Character first()
first
in interface CharSortedSet
first
in interface java.util.SortedSet<java.lang.Character>
@Deprecated public java.lang.Character last()
last
in interface CharSortedSet
last
in interface java.util.SortedSet<java.lang.Character>
@Deprecated public CharSortedSet subSet(java.lang.Character from, java.lang.Character to)
subSet
in interface CharSortedSet
subSet
in interface java.util.SortedSet<java.lang.Character>
@Deprecated public CharSortedSet headSet(java.lang.Character to)
headSet
in interface CharSortedSet
headSet
in interface java.util.SortedSet<java.lang.Character>
@Deprecated public CharSortedSet tailSet(java.lang.Character from)
tailSet
in interface CharSortedSet
tailSet
in interface java.util.SortedSet<java.lang.Character>
public boolean add(char k)
CharCollection
add
in interface CharCollection
Collection.add(Object)
public int size()
size
in interface java.util.Collection<java.lang.Character>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<java.lang.Character>
public boolean contains(char o)
CharCollection
true
if this collection contains the specified element.contains
in interface CharCollection
Collection.contains(Object)
public CharSpliterator spliterator()
CharCollection
See Collection.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface CharCollection
spliterator
in interface CharIterable
spliterator
in interface java.lang.Iterable<java.lang.Character>
spliterator
in interface java.util.Collection<java.lang.Character>
@Deprecated public java.util.stream.Stream<java.lang.Character> stream()
CharCollection
stream
in interface CharCollection
stream
in interface java.util.Collection<java.lang.Character>
@Deprecated public java.util.stream.Stream<java.lang.Character> parallelStream()
CharCollection
parallelStream
in interface CharCollection
parallelStream
in interface java.util.Collection<java.lang.Character>
public void clear()
clear
in interface java.util.Collection<java.lang.Character>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<java.lang.Character>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Character>
public void forEach(CharConsumer action)
CharIterable
Iterable
until all elements have been processed or the action throws an
exception.forEach
in interface CharIterable
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.Character>
public boolean addAll(java.util.Collection<? extends java.lang.Character> c)
addAll
in interface java.util.Collection<java.lang.Character>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<java.lang.Character>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<java.lang.Character>
public boolean removeIf(CharPredicate filter)
CharCollection
removeIf
in interface CharCollection
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.Character k)
CharCollection
add
in interface CharCollection
add
in interface java.util.Collection<java.lang.Character>
@Deprecated public boolean contains(java.lang.Object k)
CharCollection
contains
in interface CharCollection
contains
in interface java.util.Collection<java.lang.Character>
@Deprecated public boolean remove(java.lang.Object k)
CharCollection
remove
in interface CharCollection
remove
in interface java.util.Collection<java.lang.Character>
public char[] toCharArray()
CharCollection
toCharArray
in interface CharCollection
Collection.toArray()
@Deprecated public char[] toCharArray(char[] a)
CharCollection
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.
toCharArray
in interface CharCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public char[] toArray(char[] a)
CharCollection
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 CharCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean containsAll(CharCollection c)
CharCollection
containsAll
in interface CharCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean addAll(CharCollection c)
CharCollection
addAll
in interface CharCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean removeAll(CharCollection c)
CharCollection
removeAll
in interface CharCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.removeAll(Collection)
public boolean retainAll(CharCollection c)
CharCollection
retainAll
in interface CharCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
public IntIterator intIterator()
CharCollection
This method is provided for the purpose of APIs that expect only the JDK's
primitive iterators, of which there are only int
, long
, and double
.
WARNING: This is not the same as converting the source to a sequence
of code points. This returned instance literally performs (int)(charValue)
casts.
Surrogate pairs will be left as separate elements instead of combined into a single element
with the code point it represents. See Character
for more discussion on code points,
char values, and surrogate pairs.
intIterator
in interface CharCollection
intIterator
in interface CharIterable
public IntSpliterator intSpliterator()
CharCollection
This method is provided for the purpose of APIs that expect only the JDK's
primitive spliterators, of which there are only int
, long
, and double
.
WARNING: This is not the same as converting the source to a sequence
of code points. This returned instance literally performs (int)(charValue)
casts.
Surrogate pairs will be left as separate elements instead of combined into a single element
with the code point it represents. See Character
for more discussion on code points,
char values, and surrogate pairs.
intSpliterator
in interface CharCollection
intSpliterator
in interface CharIterable
public java.util.stream.IntStream intStream()
CharCollection
WARNING: This is not the same as converting the source to a sequence
of code points. This returned instance literally performs (int)(charValue)
casts.
Surrogate pairs will be left as separate elements instead of combined into a single element
with the code point it represents. See Character
for more discussion on code points,
char values, and surrogate pairs.
intStream
in interface CharCollection
Collection.stream()
,
IntStream
public java.util.stream.IntStream intParallelStream()
CharCollection
WARNING: This is not the same as converting the source to a sequence
of code points. This returned instance literally performs (int)(charValue)
casts.
Surrogate pairs will be left as separate elements instead of combined into a single element
with the code point it represents. See Character
for more discussion on code points,
char values, and surrogate pairs.
intParallelStream
in interface CharCollection
Collection.parallelStream()
,
IntStream
public java.lang.String toString()
toString
in class java.lang.Object