Class Atomic<A>

java.lang.Object
eu.bandm.tools.paisley.AbstractPattern<A>
eu.bandm.tools.paisley.Atomic<A>
Type Parameters:
A - the target type
All Implemented Interfaces:
Pattern<A>, Serializable, Cloneable
Direct Known Subclasses:
Constraint

@Generated(generator="eu.bandm.tools.expander", version="", timestamp="2026-01-24T11:39:07") public abstract class Atomic<A> extends AbstractPattern<A>
Abstract base class for patterns that contain no subpatterns. Subclasses of this class must represent deterministic patterns that affect no variable.
See Also:
  • Field Details

    • anyObject

      static final Pattern<Object> anyObject
      A pattern that matches anything. This pattern may be shared and reused concurrently.
  • Constructor Details

    • Atomic

      protected Atomic()
      Creates a new atomic pattern.
  • Method Details

    • of

      public static <A> Atomic<A> of(Predicate<? super A> pred)
    • matchAgain

      public final 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:
      false
      See Also:
    • binds

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

      The default implementation returns false.

      Parameters:
      v - a pattern variable
      Returns:
      false
    • preserves

      public final 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
    • preserves

      public final boolean preserves(Variable<?> v)
      Checks whether a variable is preserved by this pattern unconditionally.

      The default implementation returns false.

      Parameters:
      v - a pattern variable
      Returns:
      true
    • isDeterministic

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

      The default implementation returns false.

      Returns:
      true
      See Also:
    • fork

      public final Pattern<A> fork()
      Return a reference that behaves like a copy of this pattern. This implementation asserts that no duplication is required, and always returns this.
      Specified by:
      fork in interface Pattern<A>
      Overrides:
      fork in class AbstractPattern<A>
      Returns:
      a copy of this pattern that has independent internal state, except for variables