rtpi.packets
Class SourceDescriptionItem

java.lang.Object
  |
  +--rtpi.packets.SourceDescriptionItem

public class SourceDescriptionItem
extends java.lang.Object

This class is used to define SDES items that are to be used for the creation of SDES packets.


Field Summary
static int CNAME
          The ID for a CNAME item.
static int EMAIL
          The ID for an EMAIL item.
static int LOC
          The ID for a LOCation item.
static int NAME
          The ID for a NAME item.
static int NOTE
          The ID for a NOTE item.
static int PHONE
          The ID for a PHONE item.
static int PRIV
          The ID for a PRIVate extension item.
static int TOOL
          The ID for a TOOL item.
 
Constructor Summary
SourceDescriptionItem(byte[] d, byte[] p)
          This creates a new PRIV SDES item.
SourceDescriptionItem(int t, byte[] d)
          This creates a new SDES item (not a PRIV item!).
 
Method Summary
 byte[] getData()
          This returns the item data.
 byte[] getPrefix()
          This returns the prefix of a PRIV SDES item.
 int getType()
          This returns the type ID of the SDES item.
 java.lang.String toString()
          This returns this SDES item as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CNAME

public static final int CNAME
The ID for a CNAME item.

NAME

public static final int NAME
The ID for a NAME item.

EMAIL

public static final int EMAIL
The ID for an EMAIL item.

PHONE

public static final int PHONE
The ID for a PHONE item.

LOC

public static final int LOC
The ID for a LOCation item.

TOOL

public static final int TOOL
The ID for a TOOL item.

NOTE

public static final int NOTE
The ID for a NOTE item.

PRIV

public static final int PRIV
The ID for a PRIVate extension item.
Constructor Detail

SourceDescriptionItem

public SourceDescriptionItem(int t,
                             byte[] d)
                      throws IllegalValueException
This creates a new SDES item (not a PRIV item!).
Parameters:
t - The type ID of this item.
d - The item data.

SourceDescriptionItem

public SourceDescriptionItem(byte[] d,
                             byte[] p)
                      throws IllegalValueException
This creates a new PRIV SDES item.
Parameters:
d - The item data.
p - The PRIV item prefix.
Method Detail

getType

public int getType()
This returns the type ID of the SDES item.
Returns:
The type ID for this SDES item.

getData

public byte[] getData()
This returns the item data.
Returns:
The data of this SDES item.

getPrefix

public byte[] getPrefix()
                 throws IllegalValueException
This returns the prefix of a PRIV SDES item. It may only be called when the type of this SDES item is PRIV.
Returns:
The prefix of this PRIV item.

toString

public java.lang.String toString()
This returns this SDES item as a string.
Overrides:
toString in class java.lang.Object