easik.sketch.util.Export.Text
Class SQLFileBuilder

java.lang.Object
  extended by easik.sketch.util.Export.Text.SQLFileBuilder

public class SQLFileBuilder
extends java.lang.Object

Class to generate a SQL text file for exportation by the user. Deals only with fileIO and no formatting of SQL strings.

Since:
2006-05-16 Vera Ranieri
Version:
2006-08-03 Kevin Green
Author:
Vera Ranieri 2006, Kevin Green 2006

Field Summary
private  java.io.RandomAccessFile _raf
          The RandomAccessFile used to access the file
private  java.io.File _selFile
          The file selected by the user to save the text file to
 
Constructor Summary
SQLFileBuilder(ExportHandler sh)
          Create a new SQLFileBuilder from the current sketch.
 
Method Summary
private  boolean closeFile()
          Closes the currently open file
private  boolean createFile()
          Class to create a new file with the provided name.
private  boolean openFile()
          Opens newly created file for reading/writing.
 boolean writeToFile(java.lang.String s)
          Appends a string to the end of a file, as a sequence of 2-byte characters, high byte first.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_selFile

private java.io.File _selFile
The file selected by the user to save the text file to


_raf

private java.io.RandomAccessFile _raf
The RandomAccessFile used to access the file

Constructor Detail

SQLFileBuilder

public SQLFileBuilder(ExportHandler sh)
Create a new SQLFileBuilder from the current sketch. Generates a new file specified by the user containing SQL code.

Parameters:
sh - The ExportHandler used to build the information from the XML file
Method Detail

createFile

private boolean createFile()
Class to create a new file with the provided name.

Returns:
true if file was created, false otherwise

openFile

private boolean openFile()
Opens newly created file for reading/writing.

Returns:
true if file was successfully opened, false otherwise

writeToFile

public boolean writeToFile(java.lang.String s)
Appends a string to the end of a file, as a sequence of 2-byte characters, high byte first.

Parameters:
s - The string that is to be written to the file.
Returns:
True if successfully written, false otherwise.

closeFile

private boolean closeFile()
Closes the currently open file

Returns:
True if file successfully closed, false otherwise