edu.cmu.emulator.world
Class NodeDefParser

java.lang.Object
  extended by 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

Field Summary
private static boolean debug
           
private  DSPHardwareConfiguration dspHWConfig
           
 EmuNode[] emuNodes
           
protected  Logger log
           
private  boolean[] nodeDefined
           
private static int NUM_NODES
           
private  int numNodes
           
 
Constructor Summary
NodeDefParser(DSPHardwareConfiguration dspHWConfig)
           
 
Method Summary
 EmuNode[] parse(Element nodeDef)
          This method takes as input the DOM element representing the NodeDef tag and parses through its subtree.
private  Antenna[] parseAntennaDef(EmuNIC emuNIC, Element nic)
           
private  EmuNIC[] parseNICDef(EmuNode emuNode, Element node)
           
 EmuNode[] parseUserDef(EmuNode[] emuNodes, Element nodeDef)
          This method parses the NodeDef contained in the user's config file.
private  String parseWiredNICDef(Element node)
           
 void print()
          This method prints the data extracted from the NodeDef tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

NodeDefParser

public NodeDefParser(DSPHardwareConfiguration dspHWConfig)
Method Detail

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.