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

java.lang.Object
  extended by at.jku.fim.datalinksimulation.layer1.wire.damagedwire.SimpleDamagingStrategy
All Implemented Interfaces:
DamagingStrategy

public class SimpleDamagingStrategy
extends java.lang.Object
implements DamagingStrategy

Title: OSI Simulation Framework

A very simple implementation of a cable defect; a random bit of a random byte of the frame is inverted.

Copyright: (c) 2004-05

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

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

Field Summary
protected  Logger logger
          Logger instance to use
 
Constructor Summary
SimpleDamagingStrategy()
           
 
Method Summary
 RawData damageData(RawData data)
          Implementations of this method change the frame data; Damaged cables and wires are simulated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger
Logger instance to use

Constructor Detail

SimpleDamagingStrategy

public SimpleDamagingStrategy()
Method Detail

damageData

public RawData damageData(RawData data)
Description copied from interface: DamagingStrategy
Implementations of this method change the frame data; Damaged cables and wires are simulated.

Specified by:
damageData in interface DamagingStrategy
Parameters:
data - The original frame data
Returns:
Returns possibly modified or corrupted frame data or null, if strategy eats up whole frame