Package org.sqlite.date
Class FastDateParser.NumberStrategy
- java.lang.Object
-
- org.sqlite.date.FastDateParser.Strategy
-
- org.sqlite.date.FastDateParser.NumberStrategy
-
- Enclosing class:
- FastDateParser
private static class FastDateParser.NumberStrategy extends FastDateParser.Strategy
A strategy that handles a number field in the parsing pattern
-
-
Field Summary
Fields Modifier and Type Field Description private intfield
-
Constructor Summary
Constructors Constructor Description NumberStrategy(int field)Construct a Strategy that parses a Number field
-
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) booleanisNumber()Is this field a number? The default implementation returns false.(package private) intmodify(int iValue)Make any modifications to parsed integer(package private) voidsetCalendar(FastDateParser parser, java.util.Calendar cal, java.lang.String value)Set the Calendar with the parsed field.
-
-
-
Method Detail
-
isNumber
boolean isNumber()
Is this field a number? The default implementation returns false.- Overrides:
isNumberin classFastDateParser.Strategy- Returns:
- true, if field is a number
-
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
-
modify
int modify(int iValue)
Make any modifications to parsed integer- Parameters:
iValue- The parsed integer- Returns:
- The modified value
-
-