Class FastDateParser.Strategy

java.lang.Object
org.sqlite.date.FastDateParser.Strategy
Direct Known Subclasses:
FastDateParser.CaseInsensitiveTextStrategy, FastDateParser.CopyQuotedStrategy, FastDateParser.ISO8601TimeZoneStrategy, FastDateParser.NumberStrategy, FastDateParser.TimeZoneStrategy
Enclosing class:
FastDateParser

private abstract static class FastDateParser.Strategy extends Object
A strategy to parse a single field from the parsing pattern
  • Constructor Details

    • Strategy

      private Strategy()
  • Method Details

    • isNumber

      boolean isNumber()
      Is this field a number? The default implementation returns false.
      Returns:
      true, if field is a number
    • setCalendar

      void setCalendar(FastDateParser parser, Calendar cal, String value)
      Set the Calendar with the parsed field.

      The default implementation does nothing.

      Parameters:
      parser - The parser calling this strategy
      cal - The Calendar to set
      value - The parsed field to translate and set in cal
    • addRegex

      abstract boolean addRegex(FastDateParser parser, StringBuilder regex)
      Generate a Pattern regular expression to the StringBuilder which will accept this field
      Parameters:
      parser - The parser calling this strategy
      regex - The StringBuilder to append to
      Returns:
      true, if this field will set the calendar; false, if this field is a constant value