Class Filter<A>

All Implemented Interfaces:
Serializable, Cloneable

public abstract class Filter<A> extends RestrictedTransform<A,A>
Abstract base class for patterns that match only a subset of the target type.

Subclasses should override the Transform#isApplicable method.

See Also:
  • Constructor Details

    • Filter

      protected Filter(Pattern<? super A> body)
      Creates a new pattern.
  • Method Details

    • apply

      public A apply(A target)
      Transforms a target to be matched into a target for the subpattern.

      The default implementations returns target.

      Specified by:
      apply in class Transform<A,A>
      Parameters:
      target - the target for this pattern to be matched against.
      Returns:
      a target for Unary.body to be matched against.