verinec.netsim.util.tables
Class SocketSimProccessTable

java.lang.Object
  extended by java.util.AbstractMap
      extended by verinec.netsim.util.tables.SocketSimProccessTable
All Implemented Interfaces:
Map

public class SocketSimProccessTable
extends AbstractMap

Version:
$Revision: 47 $
Author:
Dominik Jungo

Nested Class Summary
protected  class SocketSimProccessTable.Entry
          The Entry of this Map containing a Key and the SimProccess that opened the Socket(Key)
protected  class SocketSimProccessTable.Key
          The key of this Map containing the localhost and destination host address and destination port.
 
Field Summary
private  HashSet entryset
           
 
Constructor Summary
SocketSimProccessTable()
          Creates a new ProccessTable
 
Method Summary
 void addEntry(IAddress localhost, IAddress dsthost, int dstport, SimProcess process)
          Creates a new Entry and adds this one to the ProcessTable
 Set entrySet()
           
 Object get(Object key)
           
 SimProcess getEntry(IAddress localhost, IAddress dsthost, int dstport)
          Gets an Entry from the ProcessTable
 SimProcess getEntry(int port)
          gets the process associated to the given port
 Object put(Object arg0, Object arg1)
           
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

entryset

private HashSet entryset
Constructor Detail

SocketSimProccessTable

public SocketSimProccessTable()
Creates a new ProccessTable

Method Detail

addEntry

public void addEntry(IAddress localhost,
                     IAddress dsthost,
                     int dstport,
                     SimProcess process)
Creates a new Entry and adds this one to the ProcessTable

Parameters:
localhost - local address of the socket
dsthost - destination address of the socket
dstport - destination port of the socket
process - proccess
See Also:
put(java.lang.Object, java.lang.Object)

getEntry

public SimProcess getEntry(IAddress localhost,
                           IAddress dsthost,
                           int dstport)
Gets an Entry from the ProcessTable

Parameters:
localhost - local address of the socket
dsthost - destination address of the socket
dstport - destination port of the socket
Returns:
the Entry from the ProcessTable associated with this Socket

getEntry

public SimProcess getEntry(int port)
gets the process associated to the given port

Parameters:
port - port of the socket which is associated to this process
Returns:
the process associated to the given port

put

public Object put(Object arg0,
                  Object arg1)
Specified by:
put in interface Map
Overrides:
put in class AbstractMap
See Also:
Map.put(java.lang.Object, java.lang.Object)

get

public Object get(Object key)
Specified by:
get in interface Map
Overrides:
get in class AbstractMap
See Also:
AbstractMap.get(java.lang.Object)

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
Specified by:
entrySet in class AbstractMap
See Also:
AbstractMap.entrySet()

Copyright © 2005 Verinec, DIUF