at.jku.fim.datalinksimulation.layer1.wire.damagedwire
Class DamagedWire

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
              extended by at.jku.fim.datalinksimulation.layer1.wire.damagedwire.DamagedWire

public class DamagedWire
extends StandardWire

Title: OSI Simulation Framework

Copyright: (c) 2004-05

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

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

Field Summary
protected  boolean damagingEnabled
          if value is set to true, damaging is performed
protected  DamagingStrategy damagingStrategy
          the strategy implementation used to "confuse" data
 
Fields inherited from class at.jku.fim.datalinksimulation.layer1.wire.StandardWire
connectors
 
Fields inherited from class at.jku.fim.datalinksimulation.genericdevices.HardwareComponent
networkComponentId
 
Constructor Summary
DamagedWire(DamagingStrategy strategy)
          Constructor
 
Method Summary
 DamagingStrategy getDamagingStrategy()
           
 boolean isDamagingEnabled()
           
 void send(WireConnector sender, RawData data)
          Send data to the wire; the data should automatically be forwarded to the directly connected WireConnectors
 void setDamagingEnabled(boolean damagingEnabled)
          Enable or disable data damaging
 void setDamagingStrategy(DamagingStrategy damagingStrategy)
          Set a new damaging strategy
 
Methods inherited from class at.jku.fim.datalinksimulation.layer1.wire.StandardWire
connect, disconnect
 
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

damagingStrategy

protected DamagingStrategy damagingStrategy
the strategy implementation used to "confuse" data


damagingEnabled

protected boolean damagingEnabled
if value is set to true, damaging is performed

Constructor Detail

DamagedWire

public DamagedWire(DamagingStrategy strategy)
Constructor

Parameters:
strategy - Inital damaging strategy; damaging is enabled by default
Method Detail

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

Overrides:
send in class StandardWire
data - The data to send

getDamagingStrategy

public DamagingStrategy getDamagingStrategy()
Returns:
Returns current active damaging strategy

setDamagingStrategy

public void setDamagingStrategy(DamagingStrategy damagingStrategy)
Set a new damaging strategy

Parameters:
damagingStrategy - New damaging strategy or null

isDamagingEnabled

public boolean isDamagingEnabled()
Returns:
Returns wheter damaging is currently enabled or not

setDamagingEnabled

public void setDamagingEnabled(boolean damagingEnabled)
Enable or disable data damaging

Parameters:
damagingEnabled - Switch