Class Pattern.Transform<A,B>

All Implemented Interfaces:
Function<A,B>
Enclosing class:
Pattern<A>

public abstract static class Pattern.Transform<A,B> extends Pattern.Unary<B,A> implements Function<A,B>
  • Constructor Details

    • Transform

      protected Transform(Pattern<? super B> body)
  • Method Details

    • match

      public boolean match(A x)
      Description copied from class: Pattern
      Attempt to match this pattern against a given object. If the class of this pattern imposes a specific order on matches, the first one is chosen. The pattern is activated on success, but deactivated on failure.
      Specified by:
      match in class Pattern<A>
    • matchAgain

      public boolean matchAgain()
      Description copied from class: Pattern
      Attempt to re-match this pattern against a previously matched object. If the class of this pattern imposes a specific order on matches, they are chosen in that order, beginning with the second one. The pattern is activated on success, but deactivated on failure. The behaviour of this method is unspecified if the pattern is currently deactivated.

      Patterns classes that do not overwrite this method guarantee

      Overrides:
      matchAgain in class Pattern<A>
    • isApplicable

      protected boolean isApplicable(A x)