Class Closure<T>

  • All Implemented Interfaces:
    java.util.function.Consumer<T>

    public class Closure<T>
    extends java.lang.Object
    implements java.util.function.Consumer<T>
    Captures a free variable for closure state of a Function.
    Author:
    Daniel Sagenschneider
    • Field Summary

      Fields 
      Modifier and Type Field Description
      T value
      Closure free variable value.
    • Constructor Summary

      Constructors 
      Constructor Description
      Closure()
      Initialise with null.
      Closure​(T initialValue)
      Initialise with initial value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(T value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Consumer

        andThen
    • Field Detail

      • value

        public T value
        Closure free variable value.
    • Constructor Detail

      • Closure

        public Closure()
        Initialise with null.
      • Closure

        public Closure​(T initialValue)
        Initialise with initial value.
        Parameters:
        initialValue - Initial value.
    • Method Detail

      • accept

        public void accept​(T value)
        Specified by:
        accept in interface java.util.function.Consumer<T>