|
Modifier and Type |
Method and Description |
|
choose |
Return one element of this set.
V choose()
throws NoSuchElementException
-
Return one element of this set.
- Throws:
NoSuchElementException - if the set is empty.
|
|
chooseOptional |
Return one element of this set, or null if the set is empty.
-
Return one element of this set, or null if the set is empty.
|
|
contains |
boolean contains(Object target)
Return true if and only if the specified element is an element of the collection.
boolean contains(Object target)
-
Return true if and only if the specified element is an element of the collection.
- Specified by:
contains in interface ICollection<V>
- Parameters:
target - The element to find in the list.
- Returns:
- true if and only if
target is an element of the collection.
|
|
element |
Return the sole element of this set.
V element()
throws NoSuchElementException
-
Return the sole element of this set.
- Throws:
NoSuchElementException - if the set does not contain exactly one element.
|
|
extending |
abstract ISet<V> extending(V value)
Return a set containing the members of this set and the specified value.
-
Return a set containing the members of this set and the specified value.
- Parameters:
value - The value to be included in the result.
- Returns:
- A set containing the values from this set and the specified value.
|
|
extendingAll |
abstract ISet<V> extendingAll(ICollection<? extends V> values)
Return a set containing the members of this set and the specified values.
-
Return a set containing the members of this set and the specified values.
- Parameters:
values - The values to be included in the result.
- Returns:
- A set containing the values from this set and the specified values.
|
|
filter |
ISet<V> filter(Predicate<V> predicate)
ISet< V> filter(Predicate< V> predicate)
|
|
find |
<R> R find(FindVisitor<V,R> visitor)
Visit the elements of the collection until the visitor returns a non-null result.
-
Visit the elements of the collection until the visitor returns a non-null result. The elements are visited in the
order defined by the collection (if there is one); otherwise, the visitation order is unspecified.
- Parameters:
visitor - The visitor to call on the elements.
- Returns:
- the first non-null result returned by the visitor, or null if none.
|
|
find |
<R> R find(FindVisitor<V,R> visitor,
R defaultValue)
Visit each element of the collection until the visitor returns a non-null result.
-
Visit each element of the collection until the visitor returns a non-null result. The elements are visited in the
order defined by the collection (if there is one); otherwise, the visitation order is unspecified.
- Parameters:
visitor - The visitor to call on the elements.defaultValue - The value to return if no visitor call returns a non-null result.
- Returns:
- the first non-null result returned by the visitor, or
defaultValue if none.
|
|
forEach |
void forEach(Consumer<? super T> arg0)
void forEach(Consumer<? super T> arg0)
|
|
intersecting |
ISet<V> intersecting(ISet<?> other)
|
|
isEmpty |
boolean isEmpty()
Return true if and only if there are no elements in the collection.
boolean isEmpty()
-
Return true if and only if there are no elements in the collection.
- Specified by:
isEmpty in interface ICollection<V>
|
|
iterator |
Returns an iterator over non-null elements of type T .
-
Returns an iterator over non-null elements of type T .
- Specified by:
iterator in interface Iterable<T>
- Returns:
- an Iterator.
|
|
map |
abstract <R> ISet<R> map(Function<V,R> mapper)
<R> ISet<R> map(Function< V,R> mapper)
|
|
ordered |
Return a set containing the members of this collection whose iteration order is defined by the natural sort order.
-
Return a set containing the members of this collection whose iteration order is defined by the natural sort order.
|
|
ordered |
ISet<V> ordered(Comparator<? super V> comp)
Return a set containing the members of this collection whose iteration order is defined by the specified comparator.
ISet< V> ordered(Comparator<? super V> comp)
-
Return a set containing the members of this collection whose iteration order is defined by the specified comparator.
|
|
removing |
abstract ISet<V> removing(Object value)
Return a set containing the members of this set excluding the specified value.
ISet< V> removing(Object value)
-
Return a set containing the members of this set excluding the specified value.
- Parameters:
value - The value to be excluded from the result.
- Returns:
- A set containing the values from this set, but not the specified value.
|
|
removingAll |
ISet<V> removingAll(ISet<?> values)
|
|
size |
abstract int size()
Return the number of elements in the collection.
int size()
-
Return the number of elements in the collection.
- Specified by:
size in interface ICollection<V>
|
|
sort |
Return a list containing the members of this collection, sorted in the natural sort order.
-
Return a list containing the members of this collection, sorted in the natural sort order.
- Returns:
- the list.
|
|
sort |
IList<V> sort(Comparator<? super V> c)
Return a list containing the same elements as this collection, but sorted using the specified comparator.
IList< V> sort(Comparator<? super V> c)
-
Return a list containing the same elements as this collection, but sorted using the specified comparator.
- Parameters:
c - The comparator used to determine the order of the elements in the returned list.
- Returns:
- the sorted list.
|
|
spliterator |
Spliterator<V> spliterator()
Return a Spliterator that yields the elements of the collection.
Spliterator< V> spliterator()
-
Return a Spliterator that yields the elements of the collection.
- Specified by:
spliterator in interface Iterable<V>
|
|
stream |
Return a stream of the elements of the collection.
-
Return a stream of the elements of the collection.
|
|
toJavaArray |
<E> E[] toJavaArray(E[] template)
Return a new Java array containing the elements of this collection.
<E> E[] toJavaArray(E[] template)
-
Return a new Java array containing the elements of this collection.
|
|
toJavaList |
Return a new Java list containing the elements of this collection, in the same order (if the collection defines an
order).
-
Return a new Java list containing the elements of this collection, in the same order (if the collection defines an
order).
|
|
toJavaSet |
Return a new Java set containing the elements of this collection.
-
Return a new Java set containing the elements of this collection.
|
|
toJavaUnmodifiableList |
List<V> toJavaUnmodifiableList()
Return a new unmodifiable Java list containing the elements of this collection, in the same order (if the
collection defines an order).
List< V> toJavaUnmodifiableList()
-
Return a new unmodifiable Java list containing the elements of this collection, in the same order (if the
collection defines an order).
|
|
toJavaUnmodifiableSet |
Set<V> toJavaUnmodifiableSet()
Return a new Java set containing the elements of this collection.
Set< V> toJavaUnmodifiableSet()
-
Return a new Java set containing the elements of this collection.
|
|
visit |
void visit(Visitor<V> visitor)
Visit each element of the collection.
-
Visit each element of the collection. The elements are visited in the order defined by the collection (if there is
one); otherwise, the visitation order is unspecified.
- Parameters:
visitor - The visitor to call on the elements.
|