Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.voytechs.jnetstream.codec
Class PacketImpl  view PacketImpl download PacketImpl.java

java.lang.Object
  extended bycom.voytechs.jnetstream.codec.PacketImpl
All Implemented Interfaces:
MutablePacket, Packet

public class PacketImpl
extends java.lang.Object
implements Packet, MutablePacket


Field Summary
private static boolean debug
           
private  java.util.Hashtable headerHash
           
private  java.util.ArrayList headerList
           
private  java.util.Hashtable perm
           
private  java.util.Hashtable temp
           
 
Fields inherited from interface com.voytechs.jnetstream.codec.Packet
CAPTURE_DEVICE_ARCH, CAPTURE_DEVICE_FILENAME, CAPTURE_DEVICE_IP, CAPTURE_DEVICE_OS, CAPTURE_TIMESTAMP, FIRST_HEADER, PACKET_END, PACKET_LENGTH, PACKET_REMAINING, PACKET_SNAPLEN, PACKET_START
 
Constructor Summary
PacketImpl(java.util.Hashtable permProperties, com.voytechs.jnetstream.io.PacketInputStream in)
           
 
Method Summary
 void addHeader(Header header)
          Adds a new header to the packet.
 Header getHeader(int index)
          Returns the indexed header from the packet.
 Header getHeader(java.lang.String name)
          Returns the named header from the packet.
 int getHeaderCount()
          Returns the size of this packet.
 com.voytechs.jnetstream.primitive.Primitive getProperty(java.lang.String name)
           
static void main(java.lang.String[] args)
          Test function for PacketImpl
protected  void setPacketPropertiesFromStream(com.voytechs.jnetstream.io.PacketInputStream in)
           
 void setProperty(java.lang.String name, com.voytechs.jnetstream.primitive.Primitive property)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

private static final boolean debug
See Also:
Constant Field Values

headerList

private java.util.ArrayList headerList

headerHash

private java.util.Hashtable headerHash

perm

private java.util.Hashtable perm

temp

private java.util.Hashtable temp
Constructor Detail

PacketImpl

public PacketImpl(java.util.Hashtable permProperties,
                  com.voytechs.jnetstream.io.PacketInputStream in)
Method Detail

setPacketPropertiesFromStream

protected void setPacketPropertiesFromStream(com.voytechs.jnetstream.io.PacketInputStream in)

setProperty

public void setProperty(java.lang.String name,
                        com.voytechs.jnetstream.primitive.Primitive property)
Specified by:
setProperty in interface MutablePacket

getProperty

public com.voytechs.jnetstream.primitive.Primitive getProperty(java.lang.String name)
Specified by:
getProperty in interface Packet

addHeader

public void addHeader(Header header)
Adds a new header to the packet.

Specified by:
addHeader in interface MutablePacket

getHeader

public Header getHeader(java.lang.String name)
Returns the named header from the packet.

Specified by:
getHeader in interface Packet

getHeader

public Header getHeader(int index)
Returns the indexed header from the packet.

Specified by:
getHeader in interface Packet

getHeaderCount

public int getHeaderCount()
Returns the size of this packet. Size refers to number of headers decoded. Only headers that this codec understands are decoded. There may be additional undecoded headers of other protocoal still in the stack.

Specified by:
getHeaderCount in interface Packet

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


main

public static void main(java.lang.String[] args)
Test function for PacketImpl