|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jsdp.MediaDescription
public class MediaDescription
A MediaDescription identifies the set of medias that may be received. It includes:
Attribute
,
Serialized FormField Summary | |
---|---|
protected HashMap |
attributes
The attribute fields |
protected HashMap |
bandwiths
The bandwith fields |
protected Connection |
c
The connection field |
protected Information |
i
The information field |
protected Key |
k
The key field |
protected Media |
m
The media field |
Constructor Summary | |
---|---|
MediaDescription(Media media)
Creates a new MediaDescription. |
Method Summary | |
---|---|
void |
addAttribute(Attribute field)
Adds an attribute field. |
void |
addBandwith(Bandwith field)
Adds a bandwith field. |
void |
clearAttributes()
Remove all attribute fields contained in the description. |
void |
clearBandwiths()
Remove all bandwith fields contained in the description. |
Object |
clone()
Returns a clone of this description. |
Attribute |
getAttribute(String name)
Returns the attribute with the specified name. |
Attribute |
getAttribute(String name,
int index)
Returns a specified occurence of an attribute with the specified name. |
Attribute[] |
getAttributes()
Returns all attribute fields. |
Attribute[] |
getAttributes(String name)
Returns the attribute fields with the specified name. |
int |
getAttributesCount(String name)
Returns the number of attribute fields with the specified name. |
Bandwith |
getBandwith(String modifier)
Returns the bandwith field with a specified modifier. |
Bandwith[] |
getBandwiths()
Returns the bandwith fields. |
Connection |
getConnection()
Returns the connection field. |
Information |
getInformation()
Returns the information field. |
Key |
getKey()
Returns the encryption key field. |
Media |
getMedia()
Returns the media field. |
boolean |
hasAttribute(String name)
Indicates if an attribute with a specified name is present. |
boolean |
hasConnection()
Indicates if the connection field is present. |
boolean |
hasInformation()
Indicates if the information field is present. |
boolean |
hasKey()
Indicates if the encryption key field is present. |
Attribute |
removeAttribute(String name)
Removes the attribute field with an associated name. |
Attribute |
removeAttribute(String name,
int index)
Removes a specified occurence of an attribute field with the specified name. |
Attribute[] |
removeAttributes(String name)
Remove all occurencies of attributes with the specified name. |
Bandwith |
removeBandwith(String modifier)
Remove the bandwith field with an associated modifier |
void |
setAttributes(Attribute[] fields)
Set attribute fields. |
void |
setBandwiths(Bandwith[] fields)
Set bandwith fields. |
void |
setConnection(Connection c)
Sets the connection field. |
void |
setInformation(Information i)
Sets the information field. |
void |
setKey(Key k)
Sets the encryption key field. |
void |
setMedia(Media m)
Sets the media field. |
String |
toString()
Returns a string representation of the description. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Media m
protected Information i
protected Connection c
protected HashMap bandwiths
protected Key k
protected HashMap attributes
Constructor Detail |
---|
public MediaDescription(Media media) throws IllegalArgumentException
media
- the media field
IllegalArgumentException
- if the media field is nullMethod Detail |
---|
public void addAttribute(Attribute field) throws IllegalArgumentException
field
- the attribute field to set
IllegalArgumentException
- if the field is nullpublic void addBandwith(Bandwith field) throws IllegalArgumentException
field
- the bandwith field to set
IllegalArgumentException
- if the bandwith field is nullpublic void clearAttributes()
public void clearBandwiths()
public Object clone()
Description
clone
in interface Description
clone
in class Object
public Attribute getAttribute(String name)
name
- the name of the attribute
public Attribute getAttribute(String name, int index)
name
- the name of the attributeindex
- the occurence index
public Attribute[] getAttributes()
public Attribute[] getAttributes(String name)
If there is only an occurence of that attribute the length of returned array is 1, instead if there aren't attributes with the given name the length of returned array is 0
name
- the name of the attribute
public int getAttributesCount(String name)
name
- the name of the attribute
public Bandwith getBandwith(String modifier)
modifier
- the bandwith modifier
public Bandwith[] getBandwiths()
public Connection getConnection()
public Information getInformation()
public Key getKey()
public Media getMedia()
public boolean hasAttribute(String name)
name
- the name of the attribute
public boolean hasConnection()
public boolean hasInformation()
public boolean hasKey()
public Attribute removeAttribute(String name)
name
- the name of the attribute field to remove
public Attribute removeAttribute(String name, int index)
name
- the name of the attributeindex
- the occurence index
public Attribute[] removeAttributes(String name)
name
- the name of the attributepublic Bandwith removeBandwith(String modifier)
modifier
- the modifier associated to the bandwith field to remove
public void setAttributes(Attribute[] fields)
fields
- the fields to set
IllegalArgumentException
- if one or more field are nullpublic void setBandwiths(Bandwith[] fields)
fields
- the fields to set
IllegalArgumentException
- if one or more field are nullpublic void setConnection(Connection c)
c
- the field to set. It can be nullpublic void setInformation(Information i)
i
- the field to set. It can be nullpublic void setKey(Key k)
k
- the field to set. It can be nullpublic void setMedia(Media m) throws IllegalArgumentException
m
- the field to set
IllegalArgumentException
- if the field is nullpublic String toString()
toString
in interface Description
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |