// Autor: Stephan Bazalka // Matr.Nr.: 0225725 // Bsp: 4100 (Token-Ring-Netzwerk) package netzwerk; public class Workstation extends Node { private boolean packetWasHere = false; // Konstruktor public Workstation(String name, Node nextNode) { super(name, nextNode); packetWasHere = false; } // Packet empfangen // Wenn das Paket die Workstation schon einmal passiert hat // (also beim Senden), wird es gelöscht. public void processPacket(Packet paket) { if(paket.tellSource().compareTo(this.tellName())==0) { if (packetWasHere) { paket.deletePacket(true); } else { packetWasHere = true; } } } }