Class Pattern.Variable<A>

java.lang.Object
eu.bandm.tools.ops.Pattern<A>
eu.bandm.tools.ops.Pattern.Variable<A>
Enclosing class:
Pattern<A>

public static class Pattern.Variable<A> extends Pattern<A>
Pattern variable.

A pattern variable is deterministic, matches any object and bind itself.

  • Constructor Details

    • Variable

      public Variable()
    • Variable

      public Variable(String name)
  • Method Details

    • getValue

      public A getValue()
    • clear

      public void clear()
    • 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>
    • bindsVariable

      public boolean bindsVariable(Pattern.Variable v)
      Specified by:
      bindsVariable in class Pattern<A>
    • disturbsVariable

      public boolean disturbsVariable(Pattern.Variable v)
      Specified by:
      disturbsVariable in class Pattern<A>
    • savesVariable

      public boolean savesVariable(Pattern.Variable v)
      Specified by:
      savesVariable in class Pattern<A>
    • isDeterministic

      public boolean isDeterministic()
      Specified by:
      isDeterministic in class Pattern<A>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • bindings

      public <B> Iterable<A> bindings(Pattern<B> root, B arg)