Class Formulas


  • public final class Formulas
    extends java.lang.Object
    The Formulas class serves as a container for formula expressions (assertions) that specify the invariants for a taken constraint.
    • Constructor Summary

      Constructors 
      Constructor Description
      Formulas()
      Constructs an empty formula container.
      Formulas​(Node formula)
      Constructs a container than contains the specified formula.
      Formulas​(Formulas formulas)
      Constructs a new formula container by copying the contents of an existing one.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Node formula)
      Adds a formula expression to the formula container.
      void addAll​(java.util.Collection<? extends Node> formulas)
      Adds all formula expression from the specified collection to the formula container.
      void addAll​(Formulas formulas)
      Adds all formula expressions from the specified formula container to the current formula container.
      Node asSingleExpr()
      Unites all stored formula expressions into a single expression using the AND operator and returns it to the client.
      boolean equals​(java.lang.Object obj)  
      java.util.List<Node> exprs()
      Provides access to the list of formula expressions.
      java.util.List<Variable> getVariables()
      Finds all variables used in the stored formula expressions and returns them to the client.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Formulas

        public Formulas()
        Constructs an empty formula container.
      • Formulas

        public Formulas​(Formulas formulas)
        Constructs a new formula container by copying the contents of an existing one.
        Parameters:
        formulas - Existing formula container.
        Throws:
        java.lang.IllegalArgumentException - if the parameter equals null.
      • Formulas

        public Formulas​(Node formula)
        Constructs a container than contains the specified formula.
        Parameters:
        formula - A formula to be placed in the container.
    • Method Detail

      • add

        public void add​(Node formula)
        Adds a formula expression to the formula container.
        Parameters:
        formula - A formula expression.
        Throws:
        java.lang.IllegalArgumentException - if the parameter equals null.
      • addAll

        public void addAll​(java.util.Collection<? extends Node> formulas)
        Adds all formula expression from the specified collection to the formula container.
        Parameters:
        formulas - A collection of formula expressions.
        Throws:
        java.lang.IllegalArgumentException - if the parameter equals null.
      • addAll

        public void addAll​(Formulas formulas)
        Adds all formula expressions from the specified formula container to the current formula container.
        Parameters:
        formulas - Formula container to be copied.
        Throws:
        java.lang.IllegalArgumentException - if the parameter equals null.
      • exprs

        public java.util.List<Node> exprs()
        Provides access to the list of formula expressions.
        Returns:
        List of formula expressions
      • asSingleExpr

        public Node asSingleExpr()
        Unites all stored formula expressions into a single expression using the AND operator and returns it to the client.
        Returns:
        A single expression for all stored formula expressions.
      • getVariables

        public java.util.List<Variable> getVariables()
        Finds all variables used in the stored formula expressions and returns them to the client.
        Returns:
        A list of all variables used in the stored formula expressions.
        Throws:
        java.lang.IllegalStateException - if the method finds nodes that refer to different variable instances that have the same name. This is illegal because all variables used in formula expression of a constraint must be accessible via its variable table (the signature of the constraint).
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object