Package GCF.original

Class GXLOutputAPI

java.lang.Object
GCF.original.GXLOutputAPI

public class GXLOutputAPI extends Object
This class is to centralize the output-management of the framework. It offers the createOutputFile(String outFile) and the closeOutputFile()- methods to handle an output File. If no output file is created, the standard-output "System.out" is used. Furthermore the methods write() and writeln() (whichs functionality should be clear) are offered. The setCurrentDepth()-method is used by the GCF.GXLConnector to let you know, what the current depth of the abstract Syntax is, so that you can layout your output accordingly. You can obtain the current depth over the getCurrentDepth()-method. For the Use of GXLOutputAPI see class "Demo" and the default-implementations. IMPORTANT : You have to copy the GXLOutputAPI into the same directory as your implementation of the GCF and to rename its package name into the package name of your implementation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates new GXLOutputAPI
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Closes the OutputFile.
    static void
    Creates an FileOutputStream if an outFile is given, otherwise uses System.out as the default outputstream.
    static int
    Returns the current depth of the Abstract Syntax Tree generated by the GCF.GXLConnector.
    static void
    setCurrentDepth(int depth)
    Sets the current depth of the Abstract Syntax Tree generated by the GCF.GXLConnector.
    static void
    write(String text)
    Writes a String onto the current OutputStream.
    static void
    Proceeds to the next line in the output file.
    static void
    Writes a String onto the current OutputStream and proceeds to the next line

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GXLOutputAPI

      public GXLOutputAPI()
      Creates new GXLOutputAPI
  • Method Details

    • createOutputFile

      public static void createOutputFile(String outFile)
      Creates an FileOutputStream if an outFile is given, otherwise uses System.out as the default outputstream.
    • write

      public static void write(String text)
      Writes a String onto the current OutputStream.
    • writeln

      public static void writeln(String text)
      Writes a String onto the current OutputStream and proceeds to the next line
    • writeln

      public static void writeln()
      Proceeds to the next line in the output file.
    • closeOutputFile

      public static void closeOutputFile()
      Closes the OutputFile.
    • setCurrentDepth

      public static void setCurrentDepth(int depth)
      Sets the current depth of the Abstract Syntax Tree generated by the GCF.GXLConnector.
    • getCurrentDepth

      public static int getCurrentDepth()
      Returns the current depth of the Abstract Syntax Tree generated by the GCF.GXLConnector.