Class All<A>

Type Parameters:
A - the target type of objects to match against
All Implemented Interfaces:
Pattern<A>, Serializable, Cloneable

@Generated(generator="eu.bandm.tools.expander", version="", timestamp="2025-12-18T16:24:32") class All<A> extends AbstractPattern<A>
Base class of variadic pattern conjunction.
  • Constructor Details

    • All

      All(Pattern<? super A>... clauses)
      Creates a new instance.
      Parameters:
      clauses - the clauses of the new formula
  • Method Details

    • getClauses

      final Pattern<? super A>[] getClauses()
      Returns a reference to the array of clauses of this formula, for internal use only.
      Returns:
      a reference to the array of clauses of this formula; do not modify!
    • match

      public boolean match(A target)
      Attempts 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 null target is generally allowed.

      Parameters:
      target - the object to match against
      Returns:
      true if the matching is successful, false if it fails. Which Variables are bound by a successful or failed match depends.
      See Also:
    • matchAgain

      public boolean matchAgain()
      Attempts 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 behaviour of this method is unspecified if the last matching attempt of this pattern has not been successful.

      Patterns classes that do not override this method are deterministic. Pattern classes that overwrite this method to provide additional matches should also override Pattern.isDeterministic().

      Returns:
      true if the matching is successful, false if it fails. Which Variables are bound by a successful match depends. The default implementation always returns false.
      See Also:
    • cut

      public void cut(boolean recursively)
      Disposes of all temporary internal state related to nondeterminism.

      The default implementation does nothing. Subclasses that override this method should also override Pattern.clear(boolean) and ensure that it implies the effect of cut(false).

      Parameters:
      recursively - true if all subpatterns should traversed, false otherwise.
    • clear

      public void clear(boolean recursively)
      Disposes of all temporary internal state related to results and nondeterminism.

      The default implementation just invokes cut(false). Subclasses that override this method should either invoke this overridden implementation, or ensure by other means that the effect of cut(false) is implied.

      Parameters:
      recursively - true if all subpatterns should be traversed, false otherwise.
    • isDeterministic

      public boolean isDeterministic()
      Checks whether this pattern is deterministic.

      The default implementation returns false.

      Returns:
      true if this pattern is guaranteed to match any object at most once, false otherwise.
      See Also: