Class Messageparser



    Purpose

    A MessageParser is to read a message string from a given input stream and then parse the message string to convert it to the certain message format.

    Functionality

    Each MessageParser is assigned a certain socket as its data input stream. The MessageParser reads the input data from that socket, the input data is a string. The MessageParser then parses this string according to the specified message format to get the value of each field in the string and stores this information in a certain Message type.

    Structure

    MessageParser has three methods: SetInputStream, getNextMessage, and readMessageString.

    SetInputStream(DataInputStream): Assign the parameter DataInputStream to be the input stream of this MessageParser.

    getNextMessage(): This method first reads the message string, and then parses it and converts it to a Message.

    readMessageString(): This method is to get the complete message string from the assigned input stream.

    See also

    Message




    [Go back to Class Index Table] [Go back to Main Page]
    [Source Code of MessageParser.java]