- java.lang.Object
-
- de.carne.text.IntegerParser
-
-
Field Summary
Fields Modifier and Type Field Description static IntegerParserANYStandard parser for any integer value.static IntegerParserPOSITIVEStandard parser for any positive integer value.
-
Constructor Summary
Constructors Constructor Description IntegerParser()Constructs a new IntegerParser accepting any integer value.IntegerParser(int min, int max)Constructs a new IntegerParser accepting integer values of the given range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integerparse(java.lang.String s)Parses the submitted string.intparseInt(java.lang.String s)Parses the submitted string.
-
-
-
Field Detail
-
ANY
public static final IntegerParser ANY
Standard parser for any integer value.
-
POSITIVE
public static final IntegerParser POSITIVE
Standard parser for any positive integer value.
-
-
Constructor Detail
-
IntegerParser
public IntegerParser()
Constructs a new IntegerParser accepting any integer value.
-
IntegerParser
public IntegerParser(int min, int max)Constructs a new IntegerParser accepting integer values of the given range.- Parameters:
min- the minimum integer value to accept.max- the maximum integer value to accept.
-
-
Method Detail
-
parse
public java.lang.Integer parse(java.lang.String s)
Description copied from interface:ParserParses the submitted string.
-
parseInt
public int parseInt(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.
-
-