|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.marineapi.nmea.sentence.SentenceValidator
public final class SentenceValidator
SentenceValidator for detecting and validation of sentence Strings.
Method Summary | |
---|---|
static boolean |
isSentence(String nmea)
Tells if the specified String matches the NMEA 0183 sentence format. |
static boolean |
isValid(String nmea)
Tells if the specified String is a valid NMEA 0183 sentence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isSentence(String nmea)
Tells if the specified String matches the NMEA 0183 sentence format.
String is considered as a sentence if it meets the following criteria:
Notice that format matching is not strict; although NMEA 0183 defines a maximum length of 80 chars, the sentence length is not checked. This is due to fact that it seems quite common that devices violate this rule, some perhaps deliberately, some by mistake. Thus, assuming the formatting is otherwise valid, it is not feasible to strictly validate length and discard sentences that just exceed the 80 chars limit.
nmea
- String to inspect
public static boolean isValid(String nmea)
isSentence(String)
test and contains correct checksum. Sentences without checksum are
validated only by checking the general sentence characteristics.
nmea
- String to validate
true
if valid, otherwise false
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |