Class StandardFolWriter

  • All Implemented Interfaces:
    FolWriter

    public class StandardFolWriter
    extends java.lang.Object
    implements FolWriter
    Writes FOL formulas and knowledge bases in the standard TweetyProject format, see parser.FolParser.
    Author:
    Matthias Thimm
    • Method Summary

      Modifier and Type Method Description
      void close()
      Closes the Writer.
      void printBase​(FolBeliefSet b)
      Prints formatted representation of a knowledge base.
      void printEquivalence​(FolFormula a, FolFormula b)
      Prints an Equivalence.
      void printQuery​(FolFormula query)
      Prints formatted representation of a query.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StandardFolWriter

        public StandardFolWriter​(java.io.Writer writer)
        Creates new writer
        Parameters:
        writer - output is redirected to this writer
      • StandardFolWriter

        public StandardFolWriter()
        Creates new writer
    • Method Detail

      • printQuery

        public void printQuery​(FolFormula query)
                        throws java.io.IOException
        Description copied from interface: FolWriter
        Prints formatted representation of a query.
        Specified by:
        printQuery in interface FolWriter
        Parameters:
        query - the formula to be queried
        Throws:
        java.io.IOException - if an IO issue occurs.
      • printEquivalence

        public void printEquivalence​(FolFormula a,
                                     FolFormula b)
                              throws java.io.IOException
        Description copied from interface: FolWriter
        Prints an Equivalence.
        Specified by:
        printEquivalence in interface FolWriter
        Parameters:
        a - formula on one side of the equation
        b - formula on the other side of the equation
        Throws:
        java.io.IOException - if an IO issue occurs.
      • printBase

        public void printBase​(FolBeliefSet b)
                       throws java.io.IOException
        Description copied from interface: FolWriter
        Prints formatted representation of a knowledge base.
        Specified by:
        printBase in interface FolWriter
        Parameters:
        b - a knowledge base
        Throws:
        java.io.IOException - if an IO issue occurs.
      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: FolWriter
        Closes the Writer.
        Specified by:
        close in interface FolWriter
        Throws:
        java.io.IOException - if an IO issue occurs.