Class Both<A>

Type Parameters:
A - the target type of objects to match against
All Implemented Interfaces:
Pattern<A>, Serializable, Cloneable
Direct Known Subclasses:
Both.Backtrack, Both.NoBacktrack

@Generated(generator="eu.bandm.tools.expander", version="", timestamp="2026-01-24T11:39:07") abstract class Both<A> extends Binary<A,A,A>
Base class of binary pattern conjunction.
  • Method Details

    • binds

      public boolean binds(Variable<?> v)
      Checks whether a variable is bound by this pattern.

      The default implementation returns false.

      Parameters:
      v - a pattern variable
      Returns:
      true if the variable is guaranteed to have a meaningful value when this pattern is open, false otherwise.
    • preserves

      public boolean preserves(Variable<?> v, boolean success)
      Checks whether a variable is preserved by this pattern, conditionally on success or failure.

      The default implementation returns false.

      Parameters:
      v - a pattern variable
      success - specifies preservation on success or failure
      Returns:
      true if the variable value is guaranteed to be unaffected by a matching attempt with this pattern that returns a value equal to success.