Package org.javimmutable.collections
Interface SplitableIterable<T>
- All Superinterfaces:
Iterable<T>
- All Known Subinterfaces:
GenericIterator.Iterable<T>
,IArray<T>
,ICollection<T>
,IDeque<T>
,IList<T>
,IListMap<K,
,V> IMap<K,
,V> IMultiset<T>
,ISet<T>
,ISetMap<K,
,V> IStreamable<T>
- All Known Implementing Classes:
AbstractMap
,AbstractMultiset
,AbstractSet
,AbstractSetUsingMap
,ArrayDeque
,EmptyHashMap
,EmptyHashSet
,EntryStreamable
,HashListMap
,HashMap
,HashMultiset
,HashSet
,HashSetMap
,LeafNode
,Maybe
,NotNull
,OrderedListMap
,OrderedMap
,OrderedMultiset
,OrderedSet
,OrderedSetMap
,TemplateSetMap
,TransformStreamable
,TreeList
,TreeListMap
,TreeMap
,TreeMultiset
,TreeSet
,TreeSetMap
,TrieArray
Extension of Iterable for objects whose iterator method returns a SplitableIterator.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <E extends Exception>
voidforEachThrows
(Proc1Throws<T, E> proc) Processes every value using the provided function.default void
indexedForEach
(IndexedProc1<T> proc) Version of forEach that includes an integer index along with each value.default <E extends Exception>
voidindexedForEachThrows
(IndexedProc1Throws<T, E> proc) Version of forEachThrows that includes an integer index along with each value.iterator()
default <V> V
Apply the specified accumulator to all elements in iterator order calling the accumulator function for each element.default <V,
E extends Exception>
VreduceThrows
(V initialValue, Sum1Throws<T, V, E> accumulator) Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
iterator
-
forEachThrows
Processes every value using the provided function.- Throws:
E
-
reduce
Apply the specified accumulator to all elements in iterator order calling the accumulator function for each element. The first call to accumulator is passed initialValue and first element in the sequence. All remaining calls to accumulator are passed the result from the previous call and next element in the sequence.- Parameters:
initialValue
- value passed to accumulator on first callaccumulator
- method called to compute result- Returns:
- result from last call to accumulator
-
reduceThrows
default <V,E extends Exception> V reduceThrows(V initialValue, Sum1Throws<T, V, throws EE> accumulator) - Throws:
E
-
indexedForEach
Version of forEach that includes an integer index along with each value. Note the index is based solely on the sequence of calls to the lambda. It is not based on any key value associated with the collection (i.e. Integer key in a map or index of an array). First value is always 0, second is always 1, etc. -
indexedForEachThrows
default <E extends Exception> void indexedForEachThrows(@Nonnull IndexedProc1Throws<T, E> proc) throws EVersion of forEachThrows that includes an integer index along with each value. Note the index is based solely on the sequence of calls to the lambda. It is not based on any key value associated with the collection (i.e. Integer key in a map or index of an array). First value is always 0, second is always 1, etc.- Throws:
E
-