gumbo.net.msg.ascii
Class AsciiMessageIO

java.lang.Object
  |
  +--gumbo.net.msg.AbstractMessageIO
        |
        +--gumbo.net.msg.ascii.AsciiMessageIO
All Implemented Interfaces:
MessageIO
Direct Known Subclasses:
AsciiMessageReader, AsciiMessageWriter

public abstract class AsciiMessageIO
extends AbstractMessageIO

Abstract base class for ASCII message transport (IO) classes (readers and writers). The message format conforms to the Destiny client-server message protocol. This class only depends on the ASCII message transport format, and not the message data format.

Provides ASCII message constants, and tracking for the current ASCII message unit.

Version:
$Revision: 1.1 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Field Summary
static int CHAR_MSG_END
          Special character delimiting the end of a message.
static int CHAR_UNIT_END
          Special character delimiting the end of a message unit.
static int UNIT_BODY
          Unit type: (first unit in message body)
static int UNIT_DATA
          Unit type: head
static int UNIT_DONE
          Unit type: (message done)
static int UNIT_FIRST
          Unit type: (first unit in message)
static int UNIT_HEAD
          Unit type: head
static int UNIT_LAST
          Unit type: (last unit in message)
static int UNIT_NONE
          Unit type: (none - undefined, unitialized)
static int UNIT_PARM
          Unit type: parameters
 
Constructor Summary
AsciiMessageIO()
           
 
Method Summary
 int currentUnit()
          Gets the current message unit type being accessed.
 void nextUnit()
          Updates the current message unit type with the next unit type.
 void resetUnit()
          Resets the message unit type to the first unit in a message.
 
Methods inherited from class gumbo.net.msg.AbstractMessageIO
addMessageIOListener, fireMessageRead, fireMessageWrite, getMessageIOListeners, removeMessageIOListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAR_MSG_END

public static final int CHAR_MSG_END
Special character delimiting the end of a message.

See Also:
Constant Field Values

CHAR_UNIT_END

public static final int CHAR_UNIT_END
Special character delimiting the end of a message unit.

See Also:
Constant Field Values

UNIT_NONE

public static final int UNIT_NONE
Unit type: (none - undefined, unitialized)

See Also:
Constant Field Values

UNIT_HEAD

public static final int UNIT_HEAD
Unit type: head

See Also:
Constant Field Values

UNIT_PARM

public static final int UNIT_PARM
Unit type: parameters

See Also:
Constant Field Values

UNIT_DATA

public static final int UNIT_DATA
Unit type: head

See Also:
Constant Field Values

UNIT_FIRST

public static final int UNIT_FIRST
Unit type: (first unit in message)

See Also:
Constant Field Values

UNIT_BODY

public static final int UNIT_BODY
Unit type: (first unit in message body)

See Also:
Constant Field Values

UNIT_LAST

public static final int UNIT_LAST
Unit type: (last unit in message)

See Also:
Constant Field Values

UNIT_DONE

public static final int UNIT_DONE
Unit type: (message done)

See Also:
Constant Field Values
Constructor Detail

AsciiMessageIO

public AsciiMessageIO()
Method Detail

currentUnit

public int currentUnit()
Gets the current message unit type being accessed.

Returns:
Unit type (UNIT_???).

nextUnit

public void nextUnit()
              throws MessageIOException
Updates the current message unit type with the next unit type. If no more units then sets the current unit type to UNIT_DONE.

Throws:
MessageIOException - Message already done.

resetUnit

public void resetUnit()
Resets the message unit type to the first unit in a message.