DRCL JavaSim API

drcl.net
Class FooPacket

java.lang.Object
  |
  +--drcl.DrclObj
        |
        +--drcl.net.Packet
              |
              +--drcl.net.FooPacket
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, PacketWrapper, java.io.Serializable

public class FooPacket
extends Packet

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

See Also:
Serialized Form

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 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.
 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, setBody, setBody, setHeaderSize, setPacketSize, setSize, 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.
Overrides:
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

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

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().
Overrides:
duplicate in class Packet

clone

public java.lang.Object clone()
Description copied from interface: PacketWrapper
Returns a clone of this wrapper instance.
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

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~