DRCL J-Sim API

drcl.net
Class FooPacket

java.lang.Object
  extended bydrcl.net.Packet
      extended bydrcl.net.FooPacket
All Implemented Interfaces:
java.lang.Cloneable, Countable, ObjectCloneable, PacketWrapper
Direct Known Subclasses:
TimestampedFooPacket

public class FooPacket
extends Packet

A packet class that keeps both packet count and byte count.


Field Summary
 
Fields inherited from class drcl.net.Packet
body, headerSize, id, size
 
Constructor Summary
FooPacket()
           
FooPacket(int pktsize_, int pktcnt_, long bytecnt_)
           
 
Method Summary
 java.lang.String _toString(java.lang.String separator_)
          Prints the packet header.
 java.lang.Object clone()
          Returns a clone of this object.
 long getByteCount()
          Returns the byte count of this packet in the connection to which this packet belongs.
 java.lang.String getName()
          Returns the name of this packet.
 int getNumberCount()
          Returns the "sequence" of the object.
 int getPacketCount()
          Returns the count of this packet in the connection to which this packet belongs.
 java.lang.String getPacketType()
          Returns null; this class does not provide packet type information.
 long getSizeCount()
          Returns the size "sequence" of the object.
 boolean isByteCountSupported()
           
 boolean isPacketCountSupported()
           
 void set(int pktcount_, long bytecount_)
           
 void setByteCount(long cnt_)
           
 void setPacketCount(int cnt_)
           
 
Methods inherited from class drcl.net.Packet
equals, getBody, getHeaderSize, getPacketSize, getSize, getTimestamp, isTimestampSupported, setBody, setBody, setHeaderSize, setPacketSize, setSize, setTimestamp, toString, toString, wraps
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FooPacket

public FooPacket()

FooPacket

public FooPacket(int pktsize_,
                 int pktcnt_,
                 long bytecnt_)
Method Detail

getName

public java.lang.String getName()
Description copied from class: Packet
Returns the name of this packet.

Specified by:
getName in class Packet

setPacketCount

public void setPacketCount(int cnt_)

getPacketCount

public int getPacketCount()
Description copied from class: Packet
Returns the count of this packet in the connection to which this packet belongs. By default, it delegates the call to the encapsulated packet, and throws a PacketException if the encapsulated object is not a packet.

Overrides:
getPacketCount in class Packet

getNumberCount

public int getNumberCount()
Description copied from interface: Countable
Returns the "sequence" of the object.

Specified by:
getNumberCount in interface Countable
Overrides:
getNumberCount in class Packet
See Also:
Packet.getPacketCount()

isPacketCountSupported

public boolean isPacketCountSupported()
Overrides:
isPacketCountSupported in class Packet

setByteCount

public void setByteCount(long cnt_)

getByteCount

public long getByteCount()
Description copied from class: Packet
Returns the byte count of this packet in the connection to which this packet belongs. By default, it delegates the call to the encapsulated packet, and throws a PacketException if the encapsulated object is not a packet. This method approximates the byte count with the byte count obtained from the encapsulated packet plus the header size times the packet count.

Overrides:
getByteCount in class Packet

getSizeCount

public long getSizeCount()
Description copied from interface: Countable
Returns the size "sequence" of the object.

Specified by:
getSizeCount in interface Countable
Overrides:
getSizeCount in class Packet
See Also:
Packet.getByteCount()

isByteCountSupported

public boolean isByteCountSupported()
Overrides:
isByteCountSupported in class Packet

set

public void set(int pktcount_,
                long bytecount_)

getPacketType

public java.lang.String getPacketType()
Returns null; this class does not provide packet type information.

Overrides:
getPacketType in class Packet

clone

public java.lang.Object clone()
Description copied from interface: ObjectCloneable
Returns a clone of this object.

Specified by:
clone in interface ObjectCloneable
Specified by:
clone in class Packet

_toString

public java.lang.String _toString(java.lang.String separator_)
Description copied from class: Packet
Prints the packet header.

Overrides:
_toString in class Packet

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~