FileDocCategorySizeDatePackage
BandwidthField.javaAPI DocphoneME MR2 API (J2ME)3846Wed May 02 18:00:42 BST 2007gov.nist.javax.sdp.fields

BandwidthField

public class BandwidthField extends SDPField
Bandwidth field of a SDP header.
version
JSR141-PUBLIC-REVIEW (Subject to change) This code is in the public domain.

Fields Summary
protected String
bwtype
Bandwidth type.
protected int
bandwidth
Current bandwidth.
Constructors Summary
public BandwidthField()
Default constructor.

	super(SDPFieldNames.BANDWIDTH_FIELD);
    
Methods Summary
public java.lang.Objectclone()
Copies the current instance.

return
the copy of this object

	BandwidthField bf  = new BandwidthField();
	bf.bwtype = bwtype;
	bf.bandwidth = bandwidth;
	return bf;
    
public java.lang.Stringencode()
Gets the string encoded version of this object.

return
the encoded string contents
since
v1.0

	String encoded_string = BANDWIDTH_FIELD;

	if (bwtype != null) encoded_string += bwtype + Separators.COLON;
	return encoded_string + bandwidth + Separators.NEWLINE; 
    
public intgetBandwidth()
Gets the current bandwith.

return
the bandwidth

	return bandwidth;
    
public java.lang.StringgetBwtype()
Gets the current bandwidth type.

return
the bandwidth type

 
	return bwtype;
    
public java.lang.StringgetType()
Returns the bandwidth type.

throws
SdpParseException if a parsing error occurs
return
type

        return  getBwtype();
    
public intgetValue()
Returns the bandwidth value measured in kilobits per second.

throws
SdpParseException if a parsing error occurs
return
the bandwidth value

        return getBandwidth();
    
public voidsetBandwidth(int b)
Sets the bandwidth member.

param
b the new value for bandwidth

	bandwidth = b;
    
public voidsetBwtype(java.lang.String b)
Sets the bandwidth type member.

param
b the new value for band width type

	bwtype = b;
    
public voidsetType(java.lang.String type)
Sets the bandwidth type.

param
type to set
throws
SdpException if the type is null

        if (type == null)
	    throw new SdpException("The type is null");
        else setBwtype(type);
    
public voidsetValue(int value)
Sets the bandwidth value.

param
value to set
throws
SdpException if the value cannot be set

        setBandwidth(value);