Module logicng

Class FormulaWriter


  • public final class FormulaWriter
    extends Object
    A writer for formulas.
    Since:
    1.2
    Version:
    1.2
    • Method Detail

      • write

        public static void write​(String fileName,
                                 Formula formula,
                                 boolean splitAndMultiline)
                          throws IOException
        Writes a given formula to a file using the formula formatter of the formula's formula factory.
        Parameters:
        fileName - the file name of the file
        formula - the formula to write
        splitAndMultiline - indicates whether - if the formula is a conjunction - the single operands should be written to different lines without a conjoining operator
        Throws:
        IOException - if there was a problem writing the file
      • write

        public static void write​(String fileName,
                                 Formula formula,
                                 boolean splitAndMultiline,
                                 FormulaStringRepresentation formatter)
                          throws IOException
        Writes a given formula to a file with a given formula formatter.
        Parameters:
        fileName - the file name of the file
        formula - the formula to write
        splitAndMultiline - indicates whether - if the formula is a conjunction - the single operands should be written to different lines without a conjoining operator
        formatter - the formatter for the formula
        Throws:
        IOException - if there was a problem writing the file
      • write

        public static void write​(File file,
                                 Formula formula,
                                 boolean splitAndMultiline)
                          throws IOException
        Writes a given formula to a file using the formula formatter of the formula's formula factory.
        Parameters:
        file - the file
        formula - the formula to write
        splitAndMultiline - indicates whether - if the formula is a conjunction - the single operands should be written to different lines without a conjoining operator
        Throws:
        IOException - if there was a problem writing the file
      • write

        public static void write​(File file,
                                 Formula formula,
                                 boolean splitAndMultiline,
                                 FormulaStringRepresentation formatter)
                          throws IOException
        Writes a given formula to a file with a given formula formatter.
        Parameters:
        file - the file
        formula - the formula to write
        splitAndMultiline - indicates whether - if the formula is a conjunction - the single operands should be written to different lines without a conjoining operator
        formatter - the formatter for the formula
        Throws:
        IOException - if there was a problem writing the file