J-Sim v1.2.1-p7 API

drcl.net
Class FooPacket

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

public class FooPacket
extends Packet

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

See Also:
Serialized Form

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 wrapper instance.
 void duplicate(java.lang.Object p_)
          opies the content of the source_ object to 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()
           
 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()
           
 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
finalize, 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()
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()
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

duplicate

public void duplicate(java.lang.Object p_)
Description copied from class: DrclObj
opies the content of the source_ object to this object. he subclass must implement this method to realize DrclObj.clone().

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class Packet

clone

public java.lang.Object clone()
Description copied from interface: PacketWrapper
Returns a clone of this wrapper instance.

Specified by:
clone in interface PacketWrapper
Overrides:
clone in class DrclObj

_toString

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

Overrides:
_toString in class Packet

J-Sim v1.2.1-p7 API

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