public static interface C.ListOrSet<T> extends C.List<T>, C.Set<T>
C.List.Cursor<T>C.Featured.Factory| Modifier and Type | Method and Description |
|---|---|
C.ListOrSet<T> |
accept(Lang.Visitor<? super T> visitor)
Iterate this
Traversable with a visitor function. |
C.ListOrSet<T> |
each(Lang.Visitor<? super T> visitor)
Alias of
C.Traversable.accept(Lang.Visitor) |
C.ListOrSet<T> |
eager()
Returns this traversable and make sure
C.Feature.LAZY is unset |
C.ListOrSet<T> |
filter(Lang.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.ListOrSet<T> |
forEach(Lang.Visitor<? super T> visitor)
Alias of
C.Traversable.accept(Lang.Visitor) |
C.ListOrSet<T> |
lazy()
Returns this traversable and make sure
C.Feature.LAZY is set |
<R> C.ListOrSet<R> |
map(Lang.Function<? super T,? extends R> mapper)
Returns an new traversable with a mapper function specified.
|
C.ListOrSet<T> |
parallel()
Returns this traversable and make sure
C.Feature.PARALLEL is set |
C.ListOrSet<T> |
sequential()
Returns this traversable and make sure
C.Feature.PARALLEL is unset |
C.ListOrSet<T> |
without(Collection<? super T> col)
Returns a List contains all elements in this List and not in the
col collection specified |
C.ListOrSet<T> |
without(T element)
Returns a list contains all elements in the list except the one specified
|
C.ListOrSet<T> |
without(T element,
T... elements)
Returns a list contains all elements in the list except the ones specified
|
accept, acceptLeft, acceptLeft, acceptRight, acceptRight, addAll, append, append, append, collect, copy, drop, dropWhile, each, flatMap, forEach, head, insert, insert, insert, locate, locateFirst, locateLast, prepend, prepend, prepend, readOnly, remove, reverse, snapshot, sorted, sorted, split, subList, tail, tail, take, takeWhile, toMap, toMapByKey, toMapByVal, unique, unique, zip, zipAll, zipWithIndexadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, toArray, toArrayappend, findLast, last, prepend, reduceRight, reduceRight, reverseIterator, zip, zipAllappend, append, append, append, asList, count, findFirst, first, head, prepend, prepend, prepend, prepend, reduce, reduce, reduceLeft, reduceLeft, zip, zipAllallMatch, anyMatch, findOne, isEmpty, noneMatch, sizefeatures, isadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamC.ListOrSet<T> parallel()
C.ListReturns this traversable and make sure C.Feature.PARALLEL is set
parallel in interface C.List<T>parallel in interface C.ReversibleSequence<T>parallel in interface C.Sequence<T>parallel in interface C.Set<T>parallel in interface C.Traversable<T>C.ListOrSet<T> sequential()
C.ListReturns this traversable and make sure C.Feature.PARALLEL is unset
sequential in interface C.List<T>sequential in interface C.ReversibleSequence<T>sequential in interface C.Sequence<T>sequential in interface C.Set<T>sequential in interface C.Traversable<T>C.ListOrSet<T> lazy()
C.ListReturns this traversable and make sure C.Feature.LAZY is set
lazy in interface C.List<T>lazy in interface C.ReversibleSequence<T>lazy in interface C.Sequence<T>lazy in interface C.Set<T>lazy in interface C.Traversable<T>C.ListOrSet<T> eager()
C.ListReturns this traversable and make sure C.Feature.LAZY is unset
eager in interface C.List<T>eager in interface C.ReversibleSequence<T>eager in interface C.Sequence<T>eager in interface C.Set<T>eager in interface C.Traversable<T>C.ListOrSet<T> accept(Lang.Visitor<? super T> visitor)
C.TraversableIterate this Traversable 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 parallel
accept in interface C.List<T>accept in interface C.ReversibleSequence<T>accept in interface C.Sequence<T>accept in interface C.Set<T>accept 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.ListOrSet<T> each(Lang.Visitor<? super T> visitor)
C.TraversableAlias of C.Traversable.accept(Lang.Visitor)
each in interface C.List<T>each in interface C.ReversibleSequence<T>each in interface C.Sequence<T>each in interface C.Set<T>each in interface C.Traversable<T>visitor - the visitor to tranverse the elementsTraversable instanceC.ListOrSet<T> forEach(Lang.Visitor<? super T> visitor)
C.TraversableAlias of C.Traversable.accept(Lang.Visitor)
forEach in interface C.List<T>forEach in interface C.ReversibleSequence<T>forEach in interface C.Sequence<T>forEach in interface C.Set<T>forEach in interface C.Traversable<T>visitor - the visitor functionTraversable instanceC.ListOrSet<T> filter(Lang.Function<? super T,Boolean> predicate)
C.SequenceReturns an new traversable that contains all elements in the current traversable except that does not pass the test of the filter function specified.
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.List<T>filter in interface C.ReversibleSequence<T>filter in interface C.Sequence<T>filter in interface C.Set<T>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.Sequence consists of elements that passed the predicateC.ListOrSet<T> without(Collection<? super T> col)
C.ListReturns a List contains all elements in this List and not in the col collection specified
C.ListOrSet<T> without(T element)
C.ListReturns a list contains all elements in the list except the one specified
C.ListOrSet<T> without(T element, T... elements)
C.ListReturns a list contains all elements in the list except the ones specified
<R> C.ListOrSet<R> map(Lang.Function<? super T,? extends R> mapper)
C.SequenceReturns an new traversable with a mapper function specified. The element in the new traversal is the result of the mapper function applied to this traversal element.
Traversable traversable = C.list(23, .NONE, null); assertEquals(C.list(true, false, false), traversal.map(.F.NOT_NULL)); assertEquals(C.list(“23”, "“, ”"), traversal.map(_.F.AS_STRING));
For Lazy Traversable, it must use lazy evaluation for this method. Otherwise it is up to implementation to decide whether use lazy evaluation or not
map in interface C.List<T>map in interface C.ReversibleSequence<T>map in interface C.Sequence<T>map in interface C.Traversable<T>R - the element type of the new traversalmapper - the function that applied to element in this traversal and returns element in the result traversalR that are mapped from this sequenceCopyright © 2014–2019 OSGL (Open Source General Library). All rights reserved.