text
Class TextFileSocket

java.lang.Object
  extended by text.TextFileSocket
All Implemented Interfaces:
TextConstants

public class TextFileSocket
extends java.lang.Object
implements TextConstants

Text File Socket Class acts as a socket between all Text file converters and the business object layer.


Field Summary
 
Fields inherited from interface text.TextConstants
COMMA, CREATED_BY_ZYX, DELIM, DOUBLE_QUOTE, ELEMENT_DOCUMENT, ELEMENT_ITEM, EMPTY, FALSE, FORWARD_SLASH, FOUR_SPACES, ID_EQUALS, JAVA_LANG_STRING, LEFT_ANGLE, LEFT_BRACE, LEFT_BRACKET, MENU_ONE, MENU_TWO, NEW_LINE, ONE, RIGHT_ANGLE, RIGHT_BRACE, RIGHT_BRACKET, SEMICOLON, SINGLE_QUOTE, SPACE, TRUE, TWO, XML_VERSION, ZERO
 
Constructor Summary
TextFileSocket()
           
 
Method Summary
static java.util.List<java.util.List<java.lang.Object>> readTextFile(java.lang.String name, char seperator, int type)
          This method chooses the file to be opened type and calls the other appropriate methods needed.
static boolean saveTextFile(java.lang.String fileName, java.util.List<java.lang.Object> columnNames, java.util.List<java.util.List<java.lang.Object>> content, int number)
          This method chooses the file saved type and calls the other appropriate methods needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFileSocket

public TextFileSocket()
Method Detail

saveTextFile

public static boolean saveTextFile(java.lang.String fileName,
                                   java.util.List<java.lang.Object> columnNames,
                                   java.util.List<java.util.List<java.lang.Object>> content,
                                   int number)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
This method chooses the file saved type and calls the other appropriate methods needed.

Parameters:
fileName - - name is the chosen name of the file.
columnNames - is the list of objects.
content - is the data needed to be saved.
number - is the menu choice between various save as types
Returns:
Throws:
java.io.FileNotFoundException - - this exception is caught at the Business Object layer to signal the file does not exist.
java.io.IOException

readTextFile

public static java.util.List<java.util.List<java.lang.Object>> readTextFile(java.lang.String name,
                                                                            char seperator,
                                                                            int type)
                                                                     throws java.io.FileNotFoundException,
                                                                            java.io.IOException,
                                                                            java.lang.InstantiationException,
                                                                            java.lang.IllegalAccessException
This method chooses the file to be opened type and calls the other appropriate methods needed.

Parameters:
name - is the given name of the file
seperator - is the designated data value delimination.
type -
Returns:
Throws:
java.io.FileNotFoundException - - this exception is caught at the Business Object layer to signal the file does not exist.
java.io.IOException - - this exception is caught at the Business Object layer to signal the I/O problem occurred.
java.lang.InstantiationException
java.lang.IllegalAccessException