Package software.kes.kraftwerk
Class ValueSupply<A>
- java.lang.Object
-
- software.kes.kraftwerk.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 typeA
.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, aValueSupply
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 aStream
from thisValueSupply
.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 software.kes.enhancediterables.ImmutableIterable
append, concat, dropWhile, filter, partition, prepend, slide, span, tails, take, takeWhile, zipWith, zipWith
-
-
-
-
Method Detail
-
head
public A head()
- Specified by:
head
in interfacesoftware.kes.enhancediterables.NonEmptyIterable<A>
-
tail
public software.kes.enhancediterables.ImmutableIterable<A> tail()
-
drop
public ValueSupply<A> drop(int count)
-
stream
public java.util.stream.Stream<A> stream()
Creates aStream
from thisValueSupply
.- Returns:
- a
Stream<A>
-
-