Top Description Fields Constructors Methods
org.apache.derby.iapi.types

pack-priv Class DateTimeParser

extends Object
Class Inheritance
Imports
org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.error.StandardException

This class provides a simple regular expression parser for standard format dates, times, and timestamps

Field Summary

Modifier and TypeField and Description
private char
private int
private int
private String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
checkEnd()

Check that we are at the end of the string: that the rest of the characters, if any, are blanks.

pack-priv char

Returns:

the separator between the last parsed integer and the next integer, 0 if the parser is at the end of the string.
getCurrentSeparator
()

pack-priv char

Returns:

the next separator, 0 if there are none
nextSeparator
()

pack-priv int

Returns:

An index in choices.
parseChoice
(String[]
An array of strings.
choices
)

Determine if the next characters are one of a choice of strings.

pack-priv int

Returns:

the integer.
parseInt
(int
the maximum number of digits
maxDigits
,
boolean
If true then leading zeroes may be ommitted. If false then the integer must be exactly ndigits long.
truncationAllowed
,
char[]
The separator at the end of the integer. If zero then the integer must be at the end of the string but may be followed by spaces.
separator
,
boolean
If true then the returned integer will be multiplied by 10**(maxDigits - actualDigitCount)
isFraction
)

Parse the next integer.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentSeparatorback to summary
private char currentSeparator
fieldStartback to summary
private int fieldStart
lenback to summary
private int len
strback to summary
private String str

Constructor Detail

DateTimeParserback to summary
pack-priv DateTimeParser(String str)

Method Detail

checkEndback to summary
pack-priv void checkEnd() throws StandardException

Check that we are at the end of the string: that the rest of the characters, if any, are blanks.

Exceptions
StandardException:
if there are more non-blank characters.
getCurrentSeparatorback to summary
pack-priv char getCurrentSeparator()
Returns:char

the separator between the last parsed integer and the next integer, 0 if the parser is at the end of the string.

nextSeparatorback to summary
pack-priv char nextSeparator()
Returns:char

the next separator, 0 if there are none

parseChoiceback to summary
pack-priv int parseChoice(String[] choices) throws StandardException

Determine if the next characters are one of a choice of strings.

Parameters
choices:String[]

An array of strings.

Returns:int

An index in choices.

Exceptions
StandardException:
if the next characters are not in choices.
parseIntback to summary
pack-priv int parseInt(int maxDigits, boolean truncationAllowed, char[] separator, boolean isFraction) throws StandardException

Parse the next integer.

Parameters
maxDigits:int

the maximum number of digits

truncationAllowed:boolean

If true then leading zeroes may be ommitted. If false then the integer must be exactly ndigits long.

separator:char[]

The separator at the end of the integer. If zero then the integer must be at the end of the string but may be followed by spaces.

isFraction:boolean

If true then the returned integer will be multiplied by 10**(maxDigits - actualDigitCount)

Returns:int

the integer.

Exceptions
StandardException:
invalid syntax.
updateCurrentSeparatorback to summary
private void updateCurrentSeparator()