at.jku.fim.datalinksimulation.layer1.wire
Class StandardWire

java.lang.Object
  extended by at.jku.fim.datalinksimulation.genericdevices.HardwareComponent
      extended by at.jku.fim.datalinksimulation.layer1.wire.Wire
          extended by at.jku.fim.datalinksimulation.layer1.wire.StandardWire
Direct Known Subclasses:
DamagedWire

public class StandardWire
extends Wire

Title: OSI Simulation Framework

This class implements a typical standard wire, connecting 2 devices. Not more than 2 WireConnectors can be connected. Data sent to the wire is forwarded to the other connector. If data is sent directly to the wire, the data is forwarded to both connected sides.

Copyright: (c) 2004-05

Company: FIM@JKU, www.fim.uni-linz.ac.at

Version:
$Id: StandardWire.java,v 1.1 2005/10/27 13:10:11 aputzinger Exp $
Author:
Andreas Putzinger

Field Summary
protected  java.util.ArrayList connectors
          Registered WireConnector instances
 
Fields inherited from class at.jku.fim.datalinksimulation.genericdevices.HardwareComponent
networkComponentId
 
Constructor Summary
StandardWire()
           
 
Method Summary
 void connect(WireConnector connector, int portNr)
          Connect wire to device
 void disconnect(WireConnector connector, int portNr)
          Disconnect wire from device
 void send(WireConnector sender, RawData data)
          Send data to the wire; the data should automatically be forwarded to the directly connected WireConnectors
 
Methods inherited from class at.jku.fim.datalinksimulation.layer1.wire.Wire
connect, disconnect
 
Methods inherited from class at.jku.fim.datalinksimulation.genericdevices.HardwareComponent
getNetworkComponentId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connectors

protected java.util.ArrayList connectors
Registered WireConnector instances

Constructor Detail

StandardWire

public StandardWire()
Method Detail

connect

public void connect(WireConnector connector,
                    int portNr)
             throws WiringException
Description copied from class: Wire
Connect wire to device

Specified by:
connect in class Wire
Parameters:
connector - Device to connect
portNr - Connect wire to port [portNr] of device
Throws:
WiringException - Thrown on wiring failure

disconnect

public void disconnect(WireConnector connector,
                       int portNr)
                throws WiringException
Description copied from class: Wire
Disconnect wire from device

Specified by:
disconnect in class Wire
Parameters:
connector - Device to disconnect
portNr - The portNr where the cable is currently plugged
Throws:
WiringException - Thrown on wiring failure

send

public void send(WireConnector sender,
                 RawData data)
Description copied from class: Wire
Send data to the wire; the data should automatically be forwarded to the directly connected WireConnectors

Specified by:
send in class Wire
data - The data to send