Package org.sqlite.date
Class FastDateParser.TimeZoneStrategy
- java.lang.Object
-
- org.sqlite.date.FastDateParser.Strategy
-
- org.sqlite.date.FastDateParser.TimeZoneStrategy
-
- Enclosing class:
- FastDateParser
private static class FastDateParser.TimeZoneStrategy extends FastDateParser.Strategy
A strategy that handles a timezone field in the parsing pattern
-
-
Field Summary
Fields Modifier and Type Field Description private static intIDIndex of zone idprivate static intLONG_DSTIndex of the long name of zone in daylight saving timeprivate static intLONG_STDIndex of the long name of zone in standard timeprivate static intSHORT_DSTIndex of the short name of zone in daylight saving timeprivate static intSHORT_STDIndex of the short name of zone in standard timeprivate java.util.SortedMap<java.lang.String,java.util.TimeZone>tzNamesprivate java.lang.StringvalidTimeZoneChars
-
Constructor Summary
Constructors Constructor Description TimeZoneStrategy(java.util.Locale locale)Construct a Strategy that parses a TimeZone
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanaddRegex(FastDateParser parser, java.lang.StringBuilder regex)Generate aPatternregular expression to theStringBuilderwhich will accept this field(package private) voidsetCalendar(FastDateParser parser, java.util.Calendar cal, java.lang.String value)Set the Calendar with the parsed field.-
Methods inherited from class org.sqlite.date.FastDateParser.Strategy
isNumber
-
-
-
-
Field Detail
-
validTimeZoneChars
private final java.lang.String validTimeZoneChars
-
tzNames
private final java.util.SortedMap<java.lang.String,java.util.TimeZone> tzNames
-
ID
private static final int ID
Index of zone id- See Also:
- Constant Field Values
-
LONG_STD
private static final int LONG_STD
Index of the long name of zone in standard time- See Also:
- Constant Field Values
-
SHORT_STD
private static final int SHORT_STD
Index of the short name of zone in standard time- See Also:
- Constant Field Values
-
LONG_DST
private static final int LONG_DST
Index of the long name of zone in daylight saving time- See Also:
- Constant Field Values
-
SHORT_DST
private static final int SHORT_DST
Index of the short name of zone in daylight saving time- See Also:
- Constant Field Values
-
-
Method Detail
-
addRegex
boolean addRegex(FastDateParser parser, java.lang.StringBuilder regex)
Generate aPatternregular expression to theStringBuilderwhich will accept this field- Specified by:
addRegexin classFastDateParser.Strategy- Parameters:
parser- The parser calling this strategyregex- TheStringBuilderto append to- Returns:
- true, if this field will set the calendar; false, if this field is a constant value
-
setCalendar
void setCalendar(FastDateParser parser, java.util.Calendar cal, java.lang.String value)
Set the Calendar with the parsed field.The default implementation does nothing.
- Overrides:
setCalendarin classFastDateParser.Strategy- Parameters:
parser- The parser calling this strategycal- TheCalendarto setvalue- The parsed field to translate and set in cal
-
-