All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.iodesystems.fn.aspects.Generators Maven / Gradle / Ivy

Go to download

Fn is a lazy Java Library that helps utilize some rudimentary functional concepts with more nounular objects

There is a newer version: 3.0.4
Show newest version
package com.iodesystems.fn.aspects;

import com.iodesystems.fn.data.From;
import com.iodesystems.fn.data.Generator;

public class Generators {

  public static  Generator of(T initial, From next) {
    return new Generator() {
      T current = initial;

      @Override
      public T next() {
        T tmp = current;
        current = next.from(current);
        return tmp;
      }
    };
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy