Class DelimitedStringParser

  extended by org.mbari.siam.distributed.PacketParser
      extended by org.mbari.siam.utils.DelimitedStringParser
All Implemented Interfaces:
Direct Known Subclasses:
BaseResponseParser, CO2SubsystemMonitorParser, CompassPacketParser, ControlLoopParser, DataLogger.RbrPacketParser, InputStateParser, OutputStateParser, Seabird52PacketParser, SeabirdPacketParser, SineDummyParser, ValveServicePacketParser, Ysi.ysiPacketParser

public abstract class DelimitedStringParser
extends PacketParser

Base class for PacketParsers which work on delimited string data. Note that PacketParser is intended to be transferred across a network, and hence implements the interface. Thus any member objects of your subclass must either implement Serializable, or be declared 'transient' or 'static'.

See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.mbari.siam.distributed.PacketParser
PacketParser.Field, PacketParser.Record
Field Summary
protected  java.lang.String _delimiters
protected  java.util.Vector _fieldVector
Fields inherited from class org.mbari.siam.distributed.PacketParser
Constructor Summary
          no arg constructor
DelimitedStringParser(java.lang.String delimiters)
          Create parser, specifying the delimiter string.
DelimitedStringParser(java.lang.String registryName, java.lang.String delimiters)
          Create parser, specifying the delimiter string.
Method Summary
protected  java.lang.Number decimalValue(java.lang.String token)
          Return Number represented by input String token; Number is null if token does not represent a decimal number.
 PacketParser.Field[] parseFields(DevicePacket packet)
          Return fields parsed from DevicePacket.
protected abstract  PacketParser.Field processToken(int nToken, java.lang.String token)
          Process the token, whose position in string is nToken.
Methods inherited from class org.mbari.siam.distributed.PacketParser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected java.lang.String _delimiters


protected java.util.Vector _fieldVector
Constructor Detail


public DelimitedStringParser()
no arg constructor


public DelimitedStringParser(java.lang.String delimiters)
Create parser, specifying the delimiter string.


public DelimitedStringParser(java.lang.String registryName,
                             java.lang.String delimiters)
Create parser, specifying the delimiter string.

Method Detail


public PacketParser.Field[] parseFields(DevicePacket packet)
                                 throws NotSupportedException,
Return fields parsed from DevicePacket.

Specified by:
parseFields in class PacketParser


protected java.lang.Number decimalValue(java.lang.String token)
Return Number represented by input String token; Number is null if token does not represent a decimal number.


protected abstract PacketParser.Field processToken(int nToken,
                                                   java.lang.String token)
                                            throws java.text.ParseException
Process the token, whose position in string is nToken. If token corresponds to a Field, create and return the field. Otherwise return null.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.