edu.cmu.emulator.world
Class NodeDefParser
java.lang.Object
edu.cmu.emulator.world.NodeDefParser
public class NodeDefParser
- extends Object
The parser for parsing the NodeDef tag in the config file.
After parsing the tag and its child nodes, this class creates
an array of EmuNode objects and populates them based on the
information extracted from the tags.
- See Also:
EmuNode
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
private static final boolean debug
- See Also:
- Constant Field Values
NUM_NODES
private static final int NUM_NODES
- See Also:
- Constant Field Values
nodeDefined
private boolean[] nodeDefined
numNodes
private int numNodes
dspHWConfig
private DSPHardwareConfiguration dspHWConfig
emuNodes
public EmuNode[] emuNodes
log
protected Logger log
NodeDefParser
public NodeDefParser(DSPHardwareConfiguration dspHWConfig)
parseUserDef
public EmuNode[] parseUserDef(EmuNode[] emuNodes,
Element nodeDef)
- This method parses the NodeDef contained in the user's config
file. It is assumed that the NodeDef in the emulab config file
has already been parsed and the list of emuNodes has been created.
parse
public EmuNode[] parse(Element nodeDef)
- This method takes as input the DOM element representing the NodeDef
tag and parses through its subtree. Also performs error checking to
see if all tags are defined properly, and generates RunTimeException
if the definition of a reqiured tag is missing.
- Parameters:
nodeDef
- The DOM element which represents the NodeDef tag subtree.
- Returns:
- The array of EmuNode object instances.
parseWiredNICDef
private String parseWiredNICDef(Element node)
parseNICDef
private EmuNIC[] parseNICDef(EmuNode emuNode,
Element node)
parseAntennaDef
private Antenna[] parseAntennaDef(EmuNIC emuNIC,
Element nic)
print
public void print()
- This method prints the data extracted from the NodeDef tag.
Copyright © 2013. All Rights Reserved.