urv.emulator
Class VirtualAddressGenerator

java.lang.Object
  extended by urv.emulator.VirtualAddressGenerator

public class VirtualAddressGenerator
extends java.lang.Object

This class generates InetAddresses for the simulation

Author:
Marcel Arrufat Arias

Constructor Summary
VirtualAddressGenerator()
           
 
Method Summary
 java.net.InetAddress createEmuInetAddress(int nodeNumber)
          Provides a new emulated address to a new node in the simulation InetAddress and hostname are created
 java.net.InetAddress getEmuInetAddress(int nodeNumber)
          Returns an already created Emulated InetAddres
 java.net.InetAddress getInetAddress(Node nodeNumber)
          Returns the InetAddress of the node from the given node number
 Node getNodeNumber(java.net.InetAddress addr)
          Returns the node number of the node from the given InetAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualAddressGenerator

public VirtualAddressGenerator()
Method Detail

createEmuInetAddress

public java.net.InetAddress createEmuInetAddress(int nodeNumber)
Provides a new emulated address to a new node in the simulation InetAddress and hostname are created

Parameters:
nodeNumber - The number of the node in the simulation
Returns:

getEmuInetAddress

public java.net.InetAddress getEmuInetAddress(int nodeNumber)
Returns an already created Emulated InetAddres


getInetAddress

public java.net.InetAddress getInetAddress(Node nodeNumber)
Returns the InetAddress of the node from the given node number

Parameters:
nodeNumber -
Returns:

getNodeNumber

public Node getNodeNumber(java.net.InetAddress addr)
Returns the node number of the node from the given InetAddress

Parameters:
addr -
Returns: