main
Class InputFileParser

java.lang.Object
  extended by main.InputFileParser

public class InputFileParser
extends java.lang.Object

The InputFileParser class parses the input file used by Visualizer and provides methods for extracting sections of the file.


Field Summary
private  java.lang.String description
           
private static int DESCRIPTION
           
private  java.lang.String edgeData
           
private static int EDGEDATA
           
private  java.lang.String edgeParameters
           
private static int EDGEPARAMETERS
           
private  java.lang.String edgeQuery
           
private static int EDGEQUERY
           
private  java.lang.String imageParameters
           
private static int IMAGEPARAMETERS
           
private  java.lang.String nodeData
           
private static int NODEDATA
           
private  java.lang.String nodeParameters
           
private static int NODEPARAMETERS
           
private  java.lang.String nodeQuery
           
private static int NODEQUERY
           
private static int NULL
           
 
Constructor Summary
InputFileParser(java.lang.String fileName)
          Creates a new InputFileParser and initializes it by parsing the file referenced by the argument.
 
Method Summary
 void createInputFile(java.lang.String fileName)
          Writes the InputFileParser to a file specified by the argument that can be read in by the Visualizer.
 java.lang.String getDescription()
          Returns the description, or null if none was specified in the file.
 java.lang.String getEdgeData()
          Returns the edge data, or null if none was specified in the file.
 java.lang.String getEdgeParameters()
          Returns the edge drawing parameters, or null if none was specified in the file.
 java.lang.String getEdgeQuery()
          Returns the edge query, or null if none was specified in the file.
 java.lang.String getImageParameters()
          Returns the image drawing parameters, or null if none was specified in the file.
 java.lang.String getNodeData()
          Returns the node data, or null if none was specified in the file.
 java.lang.String getNodeParameters()
          Returns the node drawing parameters, or null if none was specified in the file.
 java.lang.String getNodeQuery()
          Returns the node query, or null if none was specified in the file.
private  void parseInput(java.io.BufferedReader fin)
           
 void setDescription(java.lang.String description)
          Sets the description.
 void setEdgeData(java.lang.String edgeData)
          Sets the edge data and makes edge query null.
 void setEdgeParameters(java.lang.String edgeParameters)
          Sets the edge drawing parameters.
 void setEdgeQuery(java.lang.String edgeQuery)
          Sets the edge query and makes edge data null.
 void setImageParameters(java.lang.String imageParameters)
          Sets the image drawing parameters.
 void setNodeData(java.lang.String nodeData)
          Sets the node data and makes node query null.
 void setNodeParameters(java.lang.String nodeParameters)
          Sets the node drawing parameters.
 void setNodeQuery(java.lang.String nodeQuery)
          Sets the node query and makes node data null.
 java.lang.String toString()
          Returns a string representation of this InputFileParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

private static final int NULL
See Also:
Constant Field Values

NODEQUERY

private static final int NODEQUERY
See Also:
Constant Field Values

EDGEQUERY

private static final int EDGEQUERY
See Also:
Constant Field Values

NODEDATA

private static final int NODEDATA
See Also:
Constant Field Values

EDGEDATA

private static final int EDGEDATA
See Also:
Constant Field Values

NODEPARAMETERS

private static final int NODEPARAMETERS
See Also:
Constant Field Values

EDGEPARAMETERS

private static final int EDGEPARAMETERS
See Also:
Constant Field Values

IMAGEPARAMETERS

private static final int IMAGEPARAMETERS
See Also:
Constant Field Values

DESCRIPTION

private static final int DESCRIPTION
See Also:
Constant Field Values

nodeQuery

private java.lang.String nodeQuery

edgeQuery

private java.lang.String edgeQuery

nodeData

private java.lang.String nodeData

edgeData

private java.lang.String edgeData

nodeParameters

private java.lang.String nodeParameters

edgeParameters

private java.lang.String edgeParameters

imageParameters

private java.lang.String imageParameters

description

private java.lang.String description
Constructor Detail

InputFileParser

public InputFileParser(java.lang.String fileName)
                throws java.io.IOException,
                       java.io.FileNotFoundException,
                       java.text.ParseException
Creates a new InputFileParser and initializes it by parsing the file referenced by the argument.

Parameters:
fileName - a String containing the input file name
Throws:
java.io.IOException - if there's an error opening or reading the file
java.io.FileNotFoundException - if the file is not found
java.text.ParseException - if a parse error occurs
Method Detail

parseInput

private void parseInput(java.io.BufferedReader fin)
                 throws java.io.IOException,
                        java.text.ParseException
Throws:
java.io.IOException
java.text.ParseException

getNodeQuery

public java.lang.String getNodeQuery()
Returns the node query, or null if none was specified in the file.

Returns:
the node query

getEdgeQuery

public java.lang.String getEdgeQuery()
Returns the edge query, or null if none was specified in the file.

Returns:
the edge query

getNodeData

public java.lang.String getNodeData()
Returns the node data, or null if none was specified in the file.

Returns:
the node data

getEdgeData

public java.lang.String getEdgeData()
Returns the edge data, or null if none was specified in the file.

Returns:
the edge data

getNodeParameters

public java.lang.String getNodeParameters()
Returns the node drawing parameters, or null if none was specified in the file.

Returns:
the node parameters

getEdgeParameters

public java.lang.String getEdgeParameters()
Returns the edge drawing parameters, or null if none was specified in the file.

Returns:
the edge parameters

getImageParameters

public java.lang.String getImageParameters()
Returns the image drawing parameters, or null if none was specified in the file.

Returns:
the image parameters

getDescription

public java.lang.String getDescription()
Returns the description, or null if none was specified in the file.

Returns:
the description

setNodeQuery

public void setNodeQuery(java.lang.String nodeQuery)
Sets the node query and makes node data null.

Parameters:
nodeQuery - a String

setEdgeQuery

public void setEdgeQuery(java.lang.String edgeQuery)
Sets the edge query and makes edge data null.

Parameters:
edgeQuery - a String

setNodeData

public void setNodeData(java.lang.String nodeData)
Sets the node data and makes node query null.

Parameters:
nodeData - a String

setEdgeData

public void setEdgeData(java.lang.String edgeData)
Sets the edge data and makes edge query null.

Parameters:
edgeData - a String

setNodeParameters

public void setNodeParameters(java.lang.String nodeParameters)
Sets the node drawing parameters.

Parameters:
nodeParameters - a String

setEdgeParameters

public void setEdgeParameters(java.lang.String edgeParameters)
Sets the edge drawing parameters.

Parameters:
edgeParameters - a String

setImageParameters

public void setImageParameters(java.lang.String imageParameters)
Sets the image drawing parameters.

Parameters:
imageParameters - a String

setDescription

public void setDescription(java.lang.String description)
Sets the description.

Parameters:
description - a String

createInputFile

public void createInputFile(java.lang.String fileName)
                     throws java.io.IOException
Writes the InputFileParser to a file specified by the argument that can be read in by the Visualizer.

Parameters:
fileName - a String
Throws:
java.io.IOException - if the file can not be created or written

toString

public java.lang.String toString()
Returns a string representation of this InputFileParser. This is for debugging purposes only.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this InputFileParser