net.sourceforge.jsdp
Class Phone

java.lang.Object
  extended by net.sourceforge.jsdp.Phone
All Implemented Interfaces:
Serializable, Cloneable, Field

public class Phone
extends Object
implements Field

A Phone represents a p=<field value> field contained in a SDP message. A phone field specify contact information for the person responsible for the conference. This is not necessarily the same person that created the conference announcement.

Since:
0.1.0
Version:
1.0
Author:
Claudio Di Vita
See Also:
Serialized Form

Field Summary
protected  String name
          The phone user
protected  String phoneNumber
          The phone number
 
Fields inherited from interface net.sourceforge.jsdp.Field
ATTRIBUTE_FIELD, BANDWITH_FIELD, CONNECTION_FIELD, EMAIL_FIELD, END_OF_FIELD, INFORMATION_FIELD, KEY_FIELD, MEDIA_FIELD, ORIGIN_FIELD, PHONE_FIELD, REPEAT_TIME_FIELD, SESSION_NAME_FIELD, TIME_FIELD, TIMEZONE_FIELD, URI_FIELD, VERSION_FIELD
 
Constructor Summary
Phone(String number)
          Creates a new Phone.
 
Method Summary
 Object clone()
          Returns a clone of this field.
 String getName()
          Returns the name of the phone user.
 String getPhoneNumber()
          Returns the phone number.
 char getType()
          Returns the type character for the field.
static Phone parse(String field)
          Parse an input string and constructs the equivalent phone field.
 void setName(String name)
          Sets phone user name.
 void setPhoneNumber(String number)
          Sets the phone number.
 String toString()
          Returns a string representation of the field.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name
The phone user


phoneNumber

protected String phoneNumber
The phone number

Constructor Detail

Phone

public Phone(String number)
      throws SDPException
Creates a new Phone.

Parameters:
number - the phone number
Throws:
SDPException - if the phone number is not valid
Method Detail

parse

public static Phone parse(String field)
                   throws SDPParseException
Parse an input string and constructs the equivalent phone field.

Parameters:
field - the string to parse
Returns:
a new Phone instance
Throws:
SDPParseException - if an error occurs while parsing

clone

public Object clone()
Returns a clone of this field.

Specified by:
clone in interface Field
Overrides:
clone in class Object
Returns:
a clone of this field

getName

public String getName()
Returns the name of the phone user.

Returns:
the phone user

getPhoneNumber

public String getPhoneNumber()
Returns the phone number.

Returns:
the phone number

getType

public char getType()
Returns the type character for the field.

Specified by:
getType in interface Field
Returns:
the field type character: p

setName

public void setName(String name)
             throws SDPException
Sets phone user name.

Parameters:
name - the phone user name
Throws:
SDPException - if the phone user name is not valid

setPhoneNumber

public void setPhoneNumber(String number)
                    throws SDPException
Sets the phone number.

Parameters:
number - the phone number
Throws:
SDPException - if the phone number is not valid

toString

public String toString()
Returns a string representation of the field. The representation has the form: p=<value>

Specified by:
toString in interface Field
Overrides:
toString in class Object
Returns:
the string representation of the field


Copyright © 2004-2008. All Rights Reserved.