Class Hub

java.lang.Object
  |
  +--Hub

public class Hub
extends Object

Model of a network hub.

Version:
2002-04-11
Author:
Max Hailperin

Constructor Summary
Hub(int numPorts)
          Constructor for objects of class Hub
 
Method Summary
 void connect(int portNumber, Port peer)
          connects a specified port number of this Hub to another Port
 void disconnect(int portNumber)
          disconnects a specified port number of this Hub
 Port getPort(int portNum)
          returns a specified port of the Hub
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hub

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

connect

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

disconnect

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

getPort

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


Generated by BlueJ