verinec.netsim.entities.packets
Class Packet

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
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Leaf

public abstract class Packet
extends Entity
implements Cloneable

A minimal Packet with Source, Destination, Age and PacketID. The PacketID is a automatic created unique id.

Version:
$Revision:835 $
Author:
Dominik Jungo

Field Summary
private  int age
           
private  IAddress dstAddress
           
private  String packetID
           
private  IAddress srcAddress
           
 
Constructor Summary
Packet(Model owner)
          creates a new packet.
 
Method Summary
abstract  Object clone()
           
 int getAge()
          gets the packets age
 IAddress getDstAddress()
          the packets destimation address
 String getPacketID()
          gets the packets id
abstract  Object getPayload()
          gets the packets payload
abstract  String getProcessorName()
          gets the name of the processor that will process this packet
 IAddress getSrcAddress()
          gets the packets source address
 void incrAge(int amount)
          increments the packets age
 void setAge(int i)
          sets the packets age
 void setDstAddress(IAddress dstAddress)
          sets the packets destimation address
protected  void setPacketID(String string)
          sets the packets id
 void setSrcAddress(IAddress srcAddress)
          sets the packets source address
 String toString()
          This returns a String representation of the Packet.
 
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

dstAddress

private IAddress dstAddress

srcAddress

private IAddress srcAddress

age

private int age

packetID

private String packetID
Constructor Detail

Packet

public Packet(Model owner)
creates a new packet.

Parameters:
owner - a model
Method Detail

incrAge

public void incrAge(int amount)
increments the packets age

Parameters:
amount - a amount of time

getAge

public int getAge()
gets the packets age

Returns:
the packets age

setAge

public void setAge(int i)
sets the packets age

Parameters:
i - the packets age

getPayload

public abstract Object getPayload()
gets the packets payload

Returns:
the packets payload

getProcessorName

public abstract String getProcessorName()
gets the name of the processor that will process this packet

Returns:
the name of the processor that will process this packet

getDstAddress

public IAddress getDstAddress()
the packets destimation address

Returns:
the packets destimation address

setDstAddress

public void setDstAddress(IAddress dstAddress)
sets the packets destimation address

Parameters:
dstAddress - the packets destimation address

getSrcAddress

public IAddress getSrcAddress()
gets the packets source address

Returns:
the packets source address

setSrcAddress

public void setSrcAddress(IAddress srcAddress)
sets the packets source address

Parameters:
srcAddress - the packets source address

clone

public abstract Object clone()
                      throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException
See Also:
Object.clone()

getPacketID

public String getPacketID()
gets the packets id

Returns:
the packets id

setPacketID

protected void setPacketID(String string)
sets the packets id

Parameters:
string - a id

toString

public String toString()
This returns a String representation of the Packet.

Overrides:
toString in class NamedObject
Returns:
the a String representation of the Packet

Copyright © 2005 Verinec, DIUF