Class Bridge

java.lang.Object
  |
  +--Bridge

public class Bridge
extends Object

Model of a network bridge.

Version:
2002-04-11
Author:
Max Hailperin

Constructor Summary
Bridge(int numPorts)
          Constructor for objects of class Bridge
 
Method Summary
static void allTick()
          invoke the tick() method on each Bridge
 void connect(int portNumber, Port peer)
          connects a specified port number of this Bridge to another Port
 void disconnect(int portNumber)
          disconnects a specified port number of this Bridge
 int getBridgeNumber()
          returns a unique identifying number for the Bridge
 Port getPort(int portNum)
          returns a specified port of the Bridge
 void tick()
          do any housekeeping that needs doing each time interval
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bridge

public Bridge(int numPorts)
Constructor for objects of class Bridge
Parameters:
numPorts - how many Ports the Bridge should have
Method Detail

allTick

public static void allTick()
invoke the tick() method on each Bridge

connect

public void connect(int portNumber,
                    Port peer)
connects a specified port number of this Bridge to another Port
Parameters:
portNumber - specifies which port of this Bridge
peer - specifies the other Port to connect to

disconnect

public void disconnect(int portNumber)
disconnects a specified port number of this Bridge
Parameters:
portNumber - specifies which port of this Bridge

getBridgeNumber

public int getBridgeNumber()
returns a unique identifying number for the Bridge
Returns:
the Bridge's id number

getPort

public Port getPort(int portNum)
returns a specified port of the Bridge
Parameters:
portNum - specifies which port
Returns:
the specified Port

tick

public void tick()
do any housekeeping that needs doing each time interval


Generated by BlueJ