util
Class InputParser

java.lang.Object
  |
  +--util.InputParser

public class InputParser
extends java.lang.Object

This class reads in a given XML file and parses it for a variety of values which it will store in its private variables. It then provides methods for retrieving the values.


Field Summary
private  javax.xml.parsers.DocumentBuilder db
          The XML doc we create from given filename.
static java.lang.String DIRECTORY
          The directory where the configuration files are located.
private  java.lang.String mapname
          A default map.
private  java.util.Vector refpoints
          Our vector of reference points
 
Constructor Summary
InputParser(java.lang.String filename)
          This constructor builds up an XML Document of Nodes from the given XML file and then calls the method echo to retrieve the values of certain nodes.
 
Method Summary
 java.lang.String getMapFilename()
          This method is for getting the filename of the map image.
 java.util.Vector getRefPoints()
          This method is for getting the ref points of the map.
 java.lang.String getText(org.w3c.dom.Element e)
          This method takes in an Element and returns the concatenation of all of its text subnodes.
 void parse(org.w3c.dom.Document doc)
          This method takes in a Document node, which heads the XML tree structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY

public static final java.lang.String DIRECTORY
The directory where the configuration files are located.

See Also:
Constant Field Values

mapname

private java.lang.String mapname
A default map.


refpoints

private java.util.Vector refpoints
Our vector of reference points


db

private javax.xml.parsers.DocumentBuilder db
The XML doc we create from given filename.

Constructor Detail

InputParser

public InputParser(java.lang.String filename)
This constructor builds up an XML Document of Nodes from the given XML file and then calls the method echo to retrieve the values of certain nodes.

Parameters:
filename - The filename of the XML input file.
Method Detail

getText

public java.lang.String getText(org.w3c.dom.Element e)
This method takes in an Element and returns the concatenation of all of its text subnodes.

Parameters:
e - The Element to analize
Returns:
the text from all the direct subnodes of node

parse

public void parse(org.w3c.dom.Document doc)
This method takes in a Document node, which heads the XML tree structure. The method will search through all the nodes for certain named nodes which contain values we are after.


getMapFilename

public java.lang.String getMapFilename()
This method is for getting the filename of the map image.

Returns:
String The name of the map image.

getRefPoints

public java.util.Vector getRefPoints()
This method is for getting the ref points of the map.

Returns:
Vector A set of at least two reference points.