verinec.netsim.entities.packets
Class Leaf

java.lang.Object
  extended by desmoj.core.simulator.NamedObject
      extended by desmoj.core.simulator.ModelComponent
          extended by desmoj.core.simulator.Schedulable
              extended by desmoj.core.simulator.Entity
                  extended by verinec.netsim.entities.packets.Packet
                      extended by verinec.netsim.entities.packets.Leaf
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
ARPPacket, DLPacket, IPPacket, UDPPacket

public abstract class Leaf
extends Packet

A Leaf in the composite Design Pattern. A Leaf is a Packet that contains itself no more other Packets.

Version:
$Revision:835 $
Author:
Dominik Jungo

Field Summary
private  Object payload
           
 
Constructor Summary
Leaf(Model owner)
           
Leaf(Model owner, Object payload)
          Creates a new Leaf
 
Method Summary
 Object clone()
           
private  Object deepClone()
           
 Object getPayload()
          gets the packets payload
protected abstract  Leaf selfClone()
           
 void setPayload(Object payload)
          adds payload to the packet
 String toString()
          This returns a String representation of the Packet.
 
Methods inherited from class verinec.netsim.entities.packets.Packet
getAge, getDstAddress, getPacketID, getProcessorName, getSrcAddress, incrAge, setAge, setDstAddress, setPacketID, setSrcAddress
 
Methods inherited from class desmoj.core.simulator.Entity
getPriority, isEqual, isLarger, isLargerOrEqual, isNotEqual, isSimProcess, isSmaller, isSmallerOrEqual, numQueues, schedule, scheduleAfter, scheduleBefore, setPriority
 
Methods inherited from class desmoj.core.simulator.Schedulable
cancel, isCurrent, isScheduled, nextEntity, nextEvent, nextSchedulable, rename, reSchedule, scheduledAt
 
Methods inherited from class desmoj.core.simulator.ModelComponent
current, currentEntity, currentEvent, currentModel, currentSimProcess, currentTime, debugIsOn, debugOff, debugOn, epsilon, getModel, isExperimentCompatible, isModelCompatible, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
 
Methods inherited from class desmoj.core.simulator.NamedObject
getName, getQuotedName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

payload

private Object payload
Constructor Detail

Leaf

public Leaf(Model owner)
Parameters:
owner -

Leaf

public Leaf(Model owner,
            Object payload)
Creates a new Leaf

Parameters:
owner - a Model
payload - the Packets payload
Method Detail

getPayload

public Object getPayload()
Description copied from class: Packet
gets the packets payload

Specified by:
getPayload in class Packet
Returns:
the packets payload
See Also:
Packet.getPayload()

setPayload

public void setPayload(Object payload)
adds payload to the packet

Parameters:
payload - a payload

toString

public String toString()
Description copied from class: Packet
This returns a String representation of the Packet.

Overrides:
toString in class Packet
Returns:
the a String representation of the Packet
See Also:
Packet.toString()

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in class Packet
Throws:
CloneNotSupportedException
See Also:
Object.clone()

selfClone

protected abstract Leaf selfClone()

deepClone

private final Object deepClone()
                        throws CloneNotSupportedException
Throws:
CloneNotSupportedException

Copyright © 2005 Verinec, DIUF