- java.lang.Object
-
- de.carne.text.LongParser
-
-
Field Summary
Fields Modifier and Type Field Description static LongParserANYStandard parser for any long value.static LongParserPOSITIVEStandard parser for any positive long value.
-
Constructor Summary
Constructors Constructor Description LongParser()Constructs a new LongParser accepting any long value.LongParser(long min, long max)Constructs a new LongParser accepting long values of the given range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Longparse(java.lang.String s)Parses the submitted string.longparseLong(java.lang.String s)Parses the submitted string.
-
-
-
Field Detail
-
ANY
public static final LongParser ANY
Standard parser for any long value.
-
POSITIVE
public static final LongParser POSITIVE
Standard parser for any positive long value.
-
-
Constructor Detail
-
LongParser
public LongParser()
Constructs a new LongParser accepting any long value.
-
LongParser
public LongParser(long min, long max)Constructs a new LongParser accepting long values of the given range.- Parameters:
min- the minimum long value to accept.max- the maximum long value to accept.
-
-
Method Detail
-
parse
public java.lang.Long parse(java.lang.String s)
Description copied from interface:ParserParses the submitted string.
-
parseLong
public long parseLong(java.lang.String s)
Parses the submitted string.- Parameters:
s- the String to parse.- Returns:
- the parse result.
- Throws:
java.lang.RuntimeException- if the parse operation fails.
-
-