Package GCF.original
Class GXLOutputAPI
java.lang.Object
GCF.original.GXLOutputAPI
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Closes the OutputFile.static void
createOutputFile
(String outFile) 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
Writes a String onto the current OutputStream.static void
writeln()
Proceeds to the next line in the output file.static void
Writes a String onto the current OutputStream and proceeds to the next line
-
Constructor Details
-
GXLOutputAPI
public GXLOutputAPI()Creates new GXLOutputAPI
-
-
Method Details
-
createOutputFile
Creates an FileOutputStream if an outFile is given, otherwise uses System.out as the default outputstream. -
write
Writes a String onto the current OutputStream. -
writeln
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.
-