net.sourceforge.jsdp
Class Version

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

public class Version
extends Object
implements Field

A Version represents the v=<field value> field contained in a SDP message. The version field gives the version of the Session Description Protocol: there is no minor version number and the only allowed version value is 0.

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

Field Summary
static Version DEFAULT_VERSION
          The default SDP version
protected  int version
          The SDP protocol version
 
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
protected Version()
          Creates a new Version.
 
Method Summary
 Object clone()
          Returns a clone of this field.
 char getType()
          Returns the type character for the field.
 int getValue()
          Returns the SDP protocol version.
static Version parse(String field)
          Parse an input string and constructs the equivalent session name field.
protected  void setValue(int version)
          Sets the SDP protocol version
 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

DEFAULT_VERSION

public static final Version DEFAULT_VERSION
The default SDP version


version

protected int version
The SDP protocol version

Constructor Detail

Version

protected Version()
Creates a new Version. The version number is 0.

Method Detail

parse

public static Version parse(String field)
                     throws SDPParseException
Parse an input string and constructs the equivalent session name field.

Parameters:
field - the string to parse
Returns:
a new SessionName 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

getType

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

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

getValue

public int getValue()
Returns the SDP protocol version.

Returns:
the protocol version

setValue

protected void setValue(int version)
                 throws SDPException
Sets the SDP protocol version

Parameters:
version - the SDP protocol version
Throws:
SDPException - if the version specified is not valid. At this time the only version allowed is 0

toString

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

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


Copyright © 2004-2008. All Rights Reserved.