Interface IStreamable<T>

All Superinterfaces:
Iterable<T>, SplitableIterable<T>
All Known Subinterfaces:
IArray<T>, ICollection<T>, IDeque<T>, IList<T>, IListMap<K,V>, IMap<K,V>, IMultiset<T>, ISet<T>, ISetMap<K,V>
All Known Implementing Classes:
AbstractMap, AbstractMultiset, AbstractSet, AbstractSetUsingMap, ArrayDeque, EmptyHashMap, EmptyHashSet, EntryStreamable, HashListMap, HashMap, HashMultiset, HashSet, HashSetMap, Maybe, NotNull, OrderedListMap, OrderedMap, OrderedMultiset, OrderedSet, OrderedSetMap, TemplateSetMap, TransformStreamable, TreeList, TreeListMap, TreeMap, TreeMultiset, TreeSet, TreeSetMap, TrieArray

public interface IStreamable<T> extends SplitableIterable<T>
Interface for classes that can produce java.util.Streams and are also Iterable. The default stream creation implementations use spliterator().
  • Method Details

    • iterator

      Overridden here to require implementations to return a SplitableIterator rather than a basic Iterator. This is necessary to allow composition of new objects from methods like keys() and values().
      Specified by:
      iterator in interface Iterable<T>
      Specified by:
      iterator in interface SplitableIterable<T>
    • getSpliteratorCharacteristics

      int getSpliteratorCharacteristics()
      Returns:
      characteristics value used when creating Spliterators
    • spliterator

      @Nonnull default Spliterator<T> spliterator()
      Default implementation that creates a Spliterator from a newly created Iterator.
      Specified by:
      spliterator in interface Iterable<T>
    • stream

      @Nonnull default java.util.stream.Stream<T> stream()
    • parallelStream

      @Nonnull default java.util.stream.Stream<T> parallelStream()