Class EmulationCommandsParser

java.lang.Object
  extended by CommandsParser
      extended by EmulationCommandsParser

public class EmulationCommandsParser
extends CommandsParser

   
 Parser for the Emulator
 Emulator is interested in all commands except topology commands
 


Constructor Summary
EmulationCommandsParser(Emulator emulator)
          Create a new parser
 
Method Summary
protected  void exit(java.lang.String[] cmd)
          Call manager.stop() if the command is exit.
 long parseLine(java.lang.String line, long now)
          Process one line of topology file or keyboard input.
protected  void parseNodeCmd(java.lang.String[] cmd)
           
 
Methods inherited from class CommandsParser
createNewEdge, failEdge, failNode, parseCommonCmds, parseFile, parseRemainder, printStrArray, printStrArray, restartEdge, restartNode, skipLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmulationCommandsParser

public EmulationCommandsParser(Emulator emulator)
Create a new parser

Parameters:
emulator - The emulator that should be used to get messages to nodes
Method Detail

parseLine

public long parseLine(java.lang.String line,
                      long now)
Process one line of topology file or keyboard input.

Overrides:
parseLine in class CommandsParser
Parameters:
line - A command line.
now - The current time in microseconds
Returns:
How long to defer further processing. Returns -1 if do not have to defer

parseNodeCmd

protected void parseNodeCmd(java.lang.String[] cmd)
Specified by:
parseNodeCmd in class CommandsParser

exit

protected void exit(java.lang.String[] cmd)
Description copied from class: CommandsParser
Call manager.stop() if the command is exit. Actually will accept exit followed by anything Thus "exit" and "exit blahblah" will both cause fishnet to exit. However "exitblahblah" will not.

Specified by:
exit in class CommandsParser