Class ValueSupply<A>

  • Type Parameters:
    A - the element type
    All Implemented Interfaces:
    com.jnape.palatable.lambda.functor.Functor<A,​software.kes.enhancediterables.EnhancedIterable<?>>, java.lang.Iterable<A>, software.kes.enhancediterables.EnhancedIterable<A>, software.kes.enhancediterables.ImmutableIterable<A>, software.kes.enhancediterables.ImmutableNonEmptyIterable<A>, software.kes.enhancediterables.NonEmptyIterable<A>

    public final class ValueSupply<A>
    extends java.lang.Object
    implements software.kes.enhancediterables.ImmutableNonEmptyIterable<A>
    An infinite sequence of values of type A.

    A ValueSupply does not have internal state, so it can be iterated multiple times, and for each time will return the same sequence.

    Each element of a ValueSupply is lazily computed, therefore, a ValueSupply only requires a small, constant amount of memory.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ValueSupply<A> drop​(int count)  
      A head()  
      java.util.stream.Stream<A> stream()
      Creates a Stream from this ValueSupply.
      software.kes.enhancediterables.ImmutableIterable<A> tail()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface software.kes.enhancediterables.EnhancedIterable

        concat, find, toArray, toCollection, zipWith, zipWith, zipWith
      • Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

        coerce
      • Methods inherited from interface software.kes.enhancediterables.ImmutableIterable

        append, concat, dropWhile, filter, partition, prepend, slide, span, tails, take, takeWhile, zipWith, zipWith
      • Methods inherited from interface software.kes.enhancediterables.ImmutableNonEmptyIterable

        concat, fmap, intersperse, magnetizeBy, prependAll, toFinite, toNonEmpty, zipWith, zipWith
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface software.kes.enhancediterables.NonEmptyIterable

        concat, isEmpty, iterator, zipWith, zipWith
    • Method Detail

      • head

        public A head()
        Specified by:
        head in interface software.kes.enhancediterables.NonEmptyIterable<A>
      • tail

        public software.kes.enhancediterables.ImmutableIterable<A> tail()
        Specified by:
        tail in interface software.kes.enhancediterables.ImmutableNonEmptyIterable<A>
        Specified by:
        tail in interface software.kes.enhancediterables.NonEmptyIterable<A>
      • drop

        public ValueSupply<A> drop​(int count)
        Specified by:
        drop in interface software.kes.enhancediterables.EnhancedIterable<A>
        Specified by:
        drop in interface software.kes.enhancediterables.ImmutableIterable<A>
      • stream

        public java.util.stream.Stream<A> stream()
        Creates a Stream from this ValueSupply.
        Returns:
        a Stream<A>