public static interface C.Set<T> extends Set<T>, C.Traversable<T>
C.Featured.Factory| Modifier and Type | Method and Description |
|---|---|
C.Set<T> |
accept(Osgl.Function<? super T,?> visitor)
Iterate this
Traversable with a visitor function. |
C.Set<T> |
each(Osgl.Function<? super T,?> visitor)
Alias of
C.Traversable.accept(Osgl.Function) |
C.Set<T> |
eager()
Returns this traversable and turn off
C.Feature.LAZY |
C.Set<T> |
filter(Osgl.Function<? super T,Boolean> predicate)
Returns an new traversable that contains all elements in the current traversable
except that does not pass the test of the filter function specified.
|
C.Set<T> |
forEach(Osgl.Function<? super T,?> visitor)
Alias of
C.Traversable.accept(Osgl.Function) |
C.Set<T> |
lazy()
Returns this traversable and try to turn on
C.Feature.LAZY. |
C.Set<T> |
onlyIn(Collection<? extends T> col)
Returns a set contains all elements in the
col
collection specified but not in this set |
C.Set<T> |
parallel()
Returns this traversable and try to turn on
C.Feature.PARALLEL. |
C.Set<T> |
sequential()
Returns this traversable and turn off
C.Feature.PARALLEL |
C.Set<T> |
withIn(Collection<T> col)
Returns a set contains only elements in both
col
collection specified and this set |
C.Set<T> |
without(Collection<? super T> col)
Returns a set contains all elements in this set and not in
the
col collection specified |
C.Set<T> |
without(T element)
Returns a set contains all elements in the set except the
one specified
|
C.Set<T> |
without(T element,
T... elements)
Returns a set contains all elements in the set except the
ones specified
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamallMatch, anyMatch, findOne, flatMap, isEmpty, map, noneMatch, reduce, reduce, sizefeatures, isC.Set<T> parallel()
C.TraversableC.Feature.PARALLEL. If this traversable does not
support C.Feature.PARALLEL then
return this traversable directly without any state changeparallel in interface C.Traversable<T>C.Set<T> sequential()
C.TraversableC.Feature.PARALLELsequential in interface C.Traversable<T>C.Set<T> lazy()
C.TraversableC.Feature.LAZY.
If lazy is not supported then return this traversable directly without
any state changelazy in interface C.Traversable<T>C.Set<T> eager()
C.TraversableC.Feature.LAZYeager in interface C.Traversable<T>C.Set<T> filter(Osgl.Function<? super T,Boolean> predicate)
C.Traversable
Traversable traversable = C.list(-1, 0, 1, -3, 7);
Traversable filtered = traversable.filter(_.F.gt(0));
assertTrue(filtered.contains(1));
assertFalse(filtered.contains(-3));
filter in interface C.Traversable<T>predicate - the function that test if the element in the traversable should be
kept in the resulting traversable. When applying the filter function
to the element, if the result is true then the element will
be kept in the resulting traversable.C.Set<T> accept(Osgl.Function<? super T,?> visitor)
C.TraversableTraversable with a visitor function. This method
does not specify the approach to iterate through this structure. The
implementation might choose iterate from left to right, or vice versa.
It might even choose to split the structure into multiple parts, and
iterate through them in parallelaccept in interface C.Traversable<T>visitor - a function that apply to element in this
Traversable. The return value
of the function is ignoredTraversable instance for chained callC.Set<T> each(Osgl.Function<? super T,?> visitor)
C.TraversableC.Traversable.accept(Osgl.Function)each in interface C.Traversable<T>visitor - the visitor to tranverse the elementsTraversable instanceC.Set<T> forEach(Osgl.Function<? super T,?> visitor)
C.TraversableC.Traversable.accept(Osgl.Function)forEach in interface C.Traversable<T>visitor - the visitor functionTraversable instanceC.Set<T> onlyIn(Collection<? extends T> col)
col
collection specified but not in this setcol - the collection in which elements should
be included from the result setC.Set<T> withIn(Collection<T> col)
col
collection specified and this setcol - the collection in which elements should
be included from the result setC.Set<T> without(Collection<? super T> col)
col collection specifiedcol - the collection in which elements should
be excluded from the result setC.Set<T> without(T element)
element - the element that should not be in the resulting setC.Set<T> without(T element, T... elements)
element - the element that should not be in the resulting setelements - the array contains elements that should not be in the resulting setCopyright © 2017. All Rights Reserved.