jitas.xml.parser
Class ProblemParser
java.lang.Object
jitas.xml.parser.XMLParser
jitas.xml.parser.ProblemParser
public class ProblemParser
- extends XMLParser
An XML parser to parse a set of problems from a given file.
There will be one such file for each domain.
- Version:
- 09 July 2007
- Author:
- DeathMarch (c314g2)
Constructor Summary |
ProblemParser(java.lang.String pathName)
The constructor sorts out the arguments, then hands
over the DOM work to the DOM parser; which is used to build
the DOM tree and then parse the problem docs (.xml). |
Method Summary |
int |
getMaxDifficulty()
Gets the highest Problem difficulty which is in the Map |
java.util.SortedMap<java.lang.Integer,Problem> |
processTree()
Parses the XML file, creating a Problem object for each
problems represented in the file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProblemParser
public ProblemParser(java.lang.String pathName)
throws ProblemsNotFoundException
- The constructor sorts out the arguments, then hands
over the DOM work to the DOM parser; which is used to build
the DOM tree and then parse the problem docs (.xml).
- Parameters:
pathName
-
- Throws:
ProblemsNotFoundException
processTree
public java.util.SortedMap<java.lang.Integer,Problem> processTree()
throws ProblemsNotFoundException,
java.lang.NumberFormatException,
org.w3c.dom.DOMException
- Parses the XML file, creating a Problem object for each
problems represented in the file.
- Specified by:
processTree
in class XMLParser
- Returns:
- problemList a List of problems
- Throws:
org.w3c.dom.DOMException
InvalidSolutionException
InvalidSolutionException
ProblemsNotFoundException
java.lang.NumberFormatException
getMaxDifficulty
public int getMaxDifficulty()
- Gets the highest Problem difficulty which is in the Map
- Returns:
- the highest difficulty level of all the Problems