Package app.babylon.table.column.type
Interface TypeParser<T>
- Type Parameters:
T- the object value type produced byparse(CharSequence, int, int)
- All Superinterfaces:
Function<CharSequence,,T> SliceParser<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Parses textual values into a target typed value.
The primary operation is slice parsing. Whole-sequence parsing delegates to
the slice method, so type parsers can be used anywhere a SliceParser
is expected without creating intermediate strings.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Tparse(ByteSequence s, int start, int end) default Tparse(ByteString s, int start, int end) default TParses a whole character sequence into an object value.parse(CharSequence s, int start, int end) Parses a slice of a character sequence into an object value.default booleanParses a whole character sequence into a boolean value.default booleanparseBoolean(CharSequence s, int start, int end) Parses a slice of a character sequence into a boolean value.default byteparseByte(ByteSequence s, int start, int end) default byteParses a whole character sequence into a byte value.default byteparseByte(CharSequence s, int start, int end) Parses a slice of a character sequence into a byte value.default doubleParses a whole character sequence into a double value.default doubleparseDouble(CharSequence s, int start, int end) Parses a slice of a character sequence into a double value.default intparseInt(ByteSequence s, int start, int end) default intParses a whole character sequence into an int value.default intparseInt(CharSequence s, int start, int end) Parses a slice of a character sequence into an int value.default longparseLong(ByteSequence s, int start, int end) default longParses a whole character sequence into a long value.default longparseLong(CharSequence s, int start, int end) Parses a slice of a character sequence into a long value.Methods inherited from interface app.babylon.text.SliceParser
apply
-
Method Details
-
parse
Parses a slice of a character sequence into an object value.- Specified by:
parsein interfaceSliceParser<T>- Parameters:
s- the source textstart- the start indexend- one past the last character in the slice- Returns:
- the parsed value, or
nullwhen parsing fails
-
parse
-
parse
-
parse
Parses a whole character sequence into an object value.- Specified by:
parsein interfaceSliceParser<T>- Parameters:
s- the source text- Returns:
- the parsed value, or
nullwhen parsing fails
-
parseByte
Parses a whole character sequence into a byte value.- Parameters:
s- the source text- Returns:
- the parsed byte
-
parseByte
Parses a slice of a character sequence into a byte value.- Parameters:
s- the source charactersstart- the start indexend- one past the last character in the slice- Returns:
- the parsed byte
-
parseByte
-
parseBoolean
Parses a whole character sequence into a boolean value.- Parameters:
s- the source text- Returns:
- the parsed boolean
-
parseBoolean
Parses a slice of a character sequence into a boolean value.- Parameters:
s- the source textstart- the start indexend- one past the last character in the slice- Returns:
- the parsed boolean
-
parseInt
Parses a whole character sequence into an int value.- Parameters:
s- the source text- Returns:
- the parsed int
-
parseInt
Parses a slice of a character sequence into an int value.- Parameters:
s- the source textstart- the start indexend- one past the last character in the slice- Returns:
- the parsed int
-
parseInt
-
parseLong
Parses a whole character sequence into a long value.- Parameters:
s- the source text- Returns:
- the parsed long
-
parseLong
Parses a slice of a character sequence into a long value.- Parameters:
s- the source textstart- the start indexend- one past the last character in the slice- Returns:
- the parsed long
-
parseLong
-
parseDouble
Parses a whole character sequence into a double value.- Parameters:
s- the source text- Returns:
- the parsed double
-
parseDouble
Parses a slice of a character sequence into a double value.- Parameters:
s- the source textstart- the start indexend- one past the last character in the slice- Returns:
- the parsed double
-