network
Class Packet

java.lang.Object
  extended bynetwork.Packet
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
IPPacket, IPRequestPacket, XMLPacket

public abstract class Packet
extends java.lang.Object
implements java.io.Serializable

The Packet class from which all others types of packets inherit.

Author:
hoele, cooperse
See Also:
Serialized Form

Field Summary
static int IP
          Packets of this type contain an IP address payload.
static int IP_REQUEST
          Packets of this type request IPPackets from neighbor.
static int NUM_TYPES
          There are NUM_TYPES number of packet types.
static int XML
          Packets of this type contain an XML payload.
 
Constructor Summary
Packet(int type)
          Creates a new Packet of type t.
 
Method Summary
 int getType()
          Return the packet type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML

public static final int XML
Packets of this type contain an XML payload.

See Also:
Constant Field Values

IP

public static final int IP
Packets of this type contain an IP address payload.

See Also:
Constant Field Values

IP_REQUEST

public static final int IP_REQUEST
Packets of this type request IPPackets from neighbor.

See Also:
Constant Field Values

NUM_TYPES

public static final int NUM_TYPES
There are NUM_TYPES number of packet types.

See Also:
Constant Field Values
Constructor Detail

Packet

public Packet(int type)
Creates a new Packet of type t.

Parameters:
type - The Packet type intended for this Packet.
Method Detail

getType

public int getType()
Return the packet type.

Returns:
The type of Packet.