de.fhg.igd.gps
Class NMEA183Tokenizer

java.lang.Object
  extended byde.fhg.igd.gps.NMEA183Tokenizer

public class NMEA183Tokenizer
extends Object

The NMEA183Tokenizer allows an application to break a string representation of a NMEA183 sentence into tokens.

Author:
Dennis Bartussek

Field Summary
private  boolean checksumfollows_
          Flag to indicate whether the next token is a checksum or not.
private  StringTokenizer tokenizer_
           
 
Constructor Summary
(package private) NMEA183Tokenizer(String sentence)
          Constructs a new NMEA183Tokenizer to parse the specified string representation of a NMEA183Sentence sentence.
 
Method Summary
 boolean checksumFollows()
          Tests if the next token from this tokenizer is a checksum.
 boolean hasMoreTokens()
          Tests if there are more tokens available from this tokenizer's string.
 String nextToken()
          Returns the next token from this tokenizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokenizer_

private StringTokenizer tokenizer_

checksumfollows_

private boolean checksumfollows_
Flag to indicate whether the next token is a checksum or not.

Constructor Detail

NMEA183Tokenizer

NMEA183Tokenizer(String sentence)
Constructs a new NMEA183Tokenizer to parse the specified string representation of a NMEA183Sentence sentence.

Parameters:
sentence - the string representation of the NMEA183Sentence to parse
Method Detail

checksumFollows

public boolean checksumFollows()
Tests if the next token from this tokenizer is a checksum. If this method returns true a subsequent call to nextToken will return a checksum.

Returns:
true if the next token from this tokenizer is a checksum; false otherwise

hasMoreTokens

public boolean hasMoreTokens()
Tests if there are more tokens available from this tokenizer's string. If this method returns true, then a subsequent call to nextToken will successfully return a token.

Returns:
true if and only if there is at least one token in the string after the current position; false otherwise.

nextToken

public String nextToken()
                 throws NoSuchElementException
Returns the next token from this tokenizer.

Returns:
the next token from this tokenizer
Throws:
NoSuchElementException - if there are no more tokens in this tokenizer's string


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.