Class TermUtils

java.lang.Object
org.jreliability.booleanfunction.TermUtils

public class TermUtils extends Object
The TermUtils provides static methods for the Term class.
  • Method Details

    • getVariables

      public static <T> Set<T> getVariables(Term term)
      Returns the variables included in a Term.
      Type Parameters:
      T - the type of the variables
      Parameters:
      term - the term
      Returns:
      the variables included in the term
    • getVariables

      public static <T> void getVariables(Term term, Set<T> set)
      Adds the variables included in a Term to a given set of variables.
      Type Parameters:
      T - the type of the variables
      Parameters:
      term - the term
      set - the set of variables
    • getTermFromString

      public static Term getTermFromString(String string)
      Derives a Term from a given String.
      Parameters:
      string - the string encoding the term
      Returns:
      a term from a given string
    • parse

      protected static Term parse(Object object)
      Parses a Term from a given helper Object that has been derived from the original String encoding the Term.
      Parameters:
      object - the helper object
      Returns:
      a term from a given helper object
    • toObject

      protected static Object toObject(TermUtils.ParseString string)
      Transforms a given String to a helper Object that represents Terms as Lists of helper Objects and variables as Strings.
      Parameters:
      string - the string encoding the Term
      Returns:
      a helper object to parse the given string