simnet
Class TopologyParser

java.lang.Object
  extended bysimnet.TopologyParser
Direct Known Subclasses:
SimpleINetParser

abstract class TopologyParser
extends java.lang.Object

A plugin that loads nodes and links and saves the current configuration.


Field Summary
protected  int next_link_id
          The ID of the next link to create.
 
Constructor Summary
(package private) TopologyParser()
           
 
Method Summary
protected  void finalize()
          For debugging
abstract  void initialize(java.util.Hashtable router_table, java.util.Hashtable host_table, java.util.Hashtable link_table)
          Initializes a new TopologyParser by initializing pointers to the Simulator router table, host table, link table and the Simulator itself.
abstract  void load(java.lang.String filename)
          Loads the specified topology file and uses the Simulator data structures initialized in initialize(Hashtable, Hashtable, Hashtable, Hashtable) to create an appropriate network representation This is an abstract class that must be implemented by every TopologyParser.
abstract  void loadElement(java.lang.String line)
          Load a line from a configuration file.
abstract  void save(java.lang.String filename)
          Save the current state to the specified file.
abstract  void view()
          View the current topology.
abstract  void view(boolean showIPs)
          View the current topology.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next_link_id

protected int next_link_id
The ID of the next link to create. This needs to be shared between topology parsers so that new links can be added without destroying links in the simulator's hash table after a new topology parser is plugged in.

Constructor Detail

TopologyParser

TopologyParser()
Method Detail

initialize

public abstract void initialize(java.util.Hashtable router_table,
                                java.util.Hashtable host_table,
                                java.util.Hashtable link_table)
Initializes a new TopologyParser by initializing pointers to the Simulator router table, host table, link table and the Simulator itself. This is an abstract class that must be implemented by every TopologyParser.


load

public abstract void load(java.lang.String filename)
Loads the specified topology file and uses the Simulator data structures initialized in initialize(Hashtable, Hashtable, Hashtable, Hashtable) to create an appropriate network representation This is an abstract class that must be implemented by every TopologyParser.

Parameters:
filename - the topology file to load

loadElement

public abstract void loadElement(java.lang.String line)
Load a line from a configuration file.


save

public abstract void save(java.lang.String filename)
Save the current state to the specified file.


view

public abstract void view()
View the current topology.


view

public abstract void view(boolean showIPs)
View the current topology.

Parameters:
showIPs - whether or not to show the IP addresses of the nodes

finalize

protected void finalize()
For debugging