talx x1.0.5

util
Class SkillLattice

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byutil.SkillLattice
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, java.io.Serializable, SkillLatticeConstants

public class SkillLattice
extends org.xml.sax.helpers.DefaultHandler
implements java.io.Serializable, SkillLatticeConstants

This class reads in a given XML file and parses it for Skill nodes. The Skills are created, and then sorted into an ordered array and into a TreeMap for quick searching. Skills are intially soft, in that they have not instantiated their tasks or drills until the Skill is choosen by the Training program. Because the XML file may be extremely large, the XML parser used is SAX which uses much less memory than DOM. See SkillLatticeConstants.java for information on how to format the XML.

See Also:
Serialized Form

Field Summary
static Stats SKILL_STATS
           
 
Fields inherited from interface util.SkillLatticeConstants
ALIAS_ELEMENT, ALIAS_ID_ATTR, ALIAS_SKILL_ATTR, CONSTRAINT_ELEMENT, CONSTRAINT_FINAL_TOKEN, CONSTRAINT_NAME_ATTR, CONSTRAINT_ONGOING_TOKEN, CONSTRAINT_PARAM_ATTR, CONSTRAINT_STARTUP_TOKEN, CONSTRAINT_TYPE_ATTR, DESCRIPTION_ELEMENT, DRILL__RIGHT_PTR_ATTR, DRILL_CRITERIA_ATTR, DRILL_ELEMENT, DRILL_LIMIT_ATTR, DRILL_LIMIT_PTR_ATTR, DRILL_MAX_RETRIES_ATTR, DRILL_SKIPPABLE_ATTR, DRILL_WRONG_PTR_ATTR, MASTERY_CORRECT_TOKEN, MASTERY_INCORRECT_TOKEN, MASTERY_INITIAL_TOKEN, MASTERY_ONCE_TOKEN, MASTERY_OUTOF_REGEX, MASTERY_OUTOF_TOKEN, MASTERY_SEPARATOR_TOKEN, PAUSE_ELEMENT, PAUSE_LEVEL_ATTR, PAUSE_NEXT_PTR_ATTR, ROOT_ELEMENT, SKILL_BASE_DRILL_ATTR, SKILL_ELEMENT, SKILL_ID_ATTR, SKILL_PREREQUISITE_ATTR, SKILL_REFRESH_CRITERIA_ATTR, SKILL_REVIEW_CRITERIA_ATTR, STATUS_ATTEMPTED_TOKEN, STATUS_DATE_FORMAT, STATUS_IRRELEVANT_TOKEN, STATUS_LIMIT_COUNT_FORMAT, STATUS_MASTERED_TOKEN, STATUS_NEVER_ATTEMPTED_TOKEN, STATUS_REVIEWED_FAILED_TOKEN, STATUS_REVIEWED_PASSED_TOKEN, TASK_COMPONENT_ATTR, TASK_ELEMENT, TASK_TYPE_ATTR
 
Constructor Summary
SkillLattice(java.lang.String filename)
          Constructs a SkillLattice from the file at the given location.
 
Method Summary
 Skill[] getSkillArray()
          Returns all the skills topologically sorted.
 java.util.TreeMap getSkillMap()
          Returns a map of skills for quick searching.
 void merge(SkillLattice incoming)
          This method merges two sets of skills, the skills of this object and the ones passed in from the argument.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SKILL_STATS

public static Stats SKILL_STATS
Constructor Detail

SkillLattice

public SkillLattice(java.lang.String filename)
Constructs a SkillLattice from the file at the given location. The Skills are instantiated and sorted.

Parameters:
filename - The filename of XML file to parse.
Throws:
java.lang.RuntimeException - if the file cannot be found, parsed, or contains skills which do not form a lattice (ie admit no topological sort).
Method Detail

merge

public void merge(SkillLattice incoming)
           throws java.lang.Exception
This method merges two sets of skills, the skills of this object and the ones passed in from the argument. The skill arrays are joined and then resorted. If they cannot be joined due to loops or impossible prerequisits, then an Exception is thrown.

Parameters:
incoming - The new skills to merge with this object's skills.
Throws:
java.lang.Exception

getSkillArray

public Skill[] getSkillArray()
Returns all the skills topologically sorted.


getSkillMap

public java.util.TreeMap getSkillMap()
Returns a map of skills for quick searching.


talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.