Interface Action.Continuation<R,S,M,O>

Type Parameters:
R - the input type of parsing results
S - the output type of parsing results
M - the type of diagnostic messages
O - the type of obstructions to continuation
All Superinterfaces:
Function<R,Action<S,M,O>>
All Known Implementing Classes:
Parser, Parser.Proxy, Update
Enclosing class:
Action<R,M,O>
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 static interface Action.Continuation<R,S,M,O> extends Function<R,Action<S,M,O>>
Functional interface for continuations.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Action<S,M,O>
    apply(R arg)
    Applies this continuation, ignoring any recyclable leaf node.
    apply(R arg, Success<?,M,O> recyclable)
    Applies this continuation, possibly using a recyclable leaf node.
    static <R, S, M, O> Action.Continuation<R,S,M,O>
    forget(Function<? super R,? extends Action<S,M,O>> fun)
    Lifts a monadic function on parsing results to a continuation.
    static <R, S, M, O> Action.Continuation<R,S,M,O>
    map(Function<? super R,? extends S> fun)
    Lifts a function on parsing results to a monadic continuation.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • apply

      Action<S,M,O> apply(R arg, Success<?,M,O> recyclable)
      Applies this continuation, possibly using a recyclable leaf node.
      Parameters:
      arg - the input parsing result
      recyclable - a recyclable leaf node, or null if not available
      Returns:
      a leaf node with a newly computed parsing result; either recyclable if available or new.
      See Also:
    • apply

      default Action<S,M,O> apply(R arg)
      Applies this continuation, ignoring any recyclable leaf node.
      Specified by:
      apply in interface Function<R,S>
      Parameters:
      arg - the input parsing result
      Returns:
      a leaf node with a newly computed parsing result
    • forget

      static <R, S, M, O> Action.Continuation<R,S,M,O> forget(Function<? super R,? extends Action<S,M,O>> fun)
      Lifts a monadic function on parsing results to a continuation.
      Parameters:
      fun - the function
      Returns:
      a continuation that applies the function
      Throws:
      IllegalArgumentException - if fun == null
    • map

      static <R, S, M, O> Action.Continuation<R,S,M,O> map(Function<? super R,? extends S> fun)
      Lifts a function on parsing results to a monadic continuation.
      Parameters:
      fun - the function
      Returns:
      a continuation that applies the function
      Throws:
      IllegalArgumentException - if fun == null