Package cs2030s.fp

## Class Lazy<T>

- java.lang.Object
- - cs2030s.fp.Lazy<T>

- All Implemented Interfaces:
    `Immutatorable<T>`
  Direct Known Subclasses:
    `Memo`

      public class Lazy<T>
      extends java.lang.Object
      implements Immutatorable<T>

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `private Constant<? extends T>` | `init` |

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `Lazy​(Constant<? extends T> c)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static <T> Lazy<T>` | `from​(Constant<? extends T> v)` |
    `static <T> Lazy<T>` | `from​(T v)` |
    `T` | `get()` |
    `<R> Lazy<R>` | `next​(Immutator<? extends Lazy<? extends R>,​? super T> f)` |
    `java.lang.String` | `toString()` |
    `<R> Lazy<R>` | `transform​(Immutator<? extends R,​? super T> f)` | The method to produce another container with immutated element.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### init

          private Constant<? extends T> init

  - ### Constructor Detail

    - #### Lazy

          protected Lazy​(Constant<? extends T> c)

  - ### Method Detail

    - #### get

          public T get()

    - #### from

          public static <T> Lazy<T> from​(T v)

    - #### from

          public static <T> Lazy<T> from​(Constant<? extends T> v)

    - #### transform

          public <R> Lazy<R> transform​(Immutator<? extends R,​? super T> f)

      Description copied from interface: `Immutatorable`
      The method to produce another container with immutated element.
      Specified by:
        `transform` in interface `Immutatorable<T>`
      Type Parameters:
        `R` - the return type
      Parameters:
        `f` - The immutator.
      Returns:
        A new container containing the immutated element.

    - #### next

          public <R> Lazy<R> next​(Immutator<? extends Lazy<? extends R>,​? super T> f)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`