Package org.dmfs.jems2
Interface Generator<T>
-
- All Known Implementing Classes:
DelegatingGenerator,DigestGenerator,Md5,Sequence,Sha256
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Generator<T>A Generator is able to generate an infinite sequence of values. It's similar toIteratorwith the difference that a generator always has a next element, hence there is nohasNext()method.A Generator also serves as an equivalent to
Singlefor mutable values. ASingleshould not be used with mutable values because mutation of the value would affect all other uses of theSinglebecause other callers might receive the mutated value. AGeneratoron the other hand is expected to return (generate) a new instance on each call if the results are mutable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tnext()Generates and returns another value.
-
-
-
Method Detail
-
next
T next()
Generates and returns another value.
-
-