FileDocCategorySizeDatePackage
BandwidthFieldParser.javaAPI DocphoneME MR2 API (J2ME)2585Wed May 02 18:00:42 BST 2007gov.nist.javax.sdp.parser

BandwidthFieldParser

public class BandwidthFieldParser extends SDPParser
Bandwidth field parser.
version
1.0

Fields Summary
Constructors Summary
public BandwidthFieldParser(String bandwidthField)
Creates new BandwidthFieldParser.

param
bandwidthField the bandwidth string to be parsed

        lexer = new Lexer("charLexer", bandwidthField);
    
protected BandwidthFieldParser()
Default constructor.

        super();
    
Methods Summary
public BandwidthFieldbandwidthField()
Perform the bandwidth field parsing

return
the parsed bandwidth field
exception
ParseException if a parsing error occurs

        lexer.match('b");
        lexer.SPorHT();
        lexer.match('=");
        lexer.SPorHT();

        BandwidthField bandwidthField = new BandwidthField();

        NameValue nameValue = nameValue(':");
        String name = nameValue.getName();
        String value = (String) nameValue.getValue();

        bandwidthField.setBandwidth(Integer.parseInt(value.trim()));
        bandwidthField.setBwtype(name);

        lexer.SPorHT();
        return bandwidthField;
    
public SDPFieldparse()
Perform the bandwidth field parsing

return
the parsed bandwidth field
exception
ParseException if a parsing error occurs

 
        return bandwidthField();