Class Signature.Pat

Enclosing class:
Signature

public static final class Signature.Pat extends Signature.InnerSig
A Signature representing a pattern {u,v} .
  • Constructor Details

    • Pat

      public Pat()
  • Method Details

    • add

      public void add(Signature.InnerSig sig)
      Add a signature to the list.
      Parameters:
      sig - signature to add
    • getSigs

      public List<Signature.InnerSig> getSigs()
      Description copied from class: Signature
      Return a list of signatures
      Specified by:
      getSigs in class Signature.InnerSig
      Returns:
      either a list or an empty list
    • isSimple

      public boolean isSimple()
      Description copied from class: Signature
      Simple signatures like x or [x,y,z]
      Specified by:
      isSimple in class Signature
      Returns:
      true if it is simple
    • size

      public int size()
      Description copied from class: Signature
      Number of element in a compound signature
      Specified by:
      size in class Signature
      Returns:
      number of elements, 1 for variables
    • calculateArgs

      protected void calculateArgs(Stack<Object> stack, List<Object> args) throws EvaluationException
      Description copied from class: Signature
      Convert arguments on the stack to a list of arguments matching the pattern in this signature
      Specified by:
      calculateArgs in class Signature
      Parameters:
      stack - input arguments to the function
      args - output list of values matching the variables in the signature
      Throws:
      EvaluationException - on error
    • calculateArgs

      protected void calculateArgs(Object ele, List<Object> args) throws EvaluationException
      Description copied from class: Signature.InnerSig
      Convert an input arguments to a list of arguments matching the pattern in this signature
      Specified by:
      calculateArgs in class Signature.InnerSig
      Parameters:
      ele - input argument, typically a Vector<Object>, VectorI or MatrixI. Nested vectors are extracted recursively.
      args - output list of values matching the variables in the signature
      Throws:
      EvaluationException - if the input argument does not match the pattern in this signature
    • toString

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

      protected boolean match(Object x)
      Specified by:
      match in class Signature
    • match

      protected boolean match(Object x, Object y)
      Specified by:
      match in class Signature
    • matchN

      public boolean matchN(Object[] args)
      Specified by:
      matchN in class Signature