Class DateValueFacts

java.lang.Object
app.babylon.table.transform.DateValueFacts

public final class DateValueFacts extends Object
Lightweight facts extracted from a date candidate string.
  • Method Details

    • from

      public static DateValueFacts from(CharSequence value)
      Builds date facts from the supplied text.
      Parameters:
      value - text to inspect
      Returns:
      extracted facts or null
    • text

      public String text()
      Returns the stripped source text.
    • size

      public int size()
      Returns the stripped text length.
    • onlyDigits

      public boolean onlyDigits()
      Returns whether the stripped text contains digits only.
    • isDecimal

      public boolean isDecimal()
      Returns whether the text also looks like a decimal number.
    • alphaCount

      public int alphaCount()
      Returns the number of alphabetic characters.
    • hasCommas

      public boolean hasCommas()
      Returns whether the text contains commas.
    • hasPeriods

      public boolean hasPeriods()
      Returns whether the text contains periods.
    • invalidForDateTokens

      public boolean invalidForDateTokens()
      Returns whether the text has token shapes that disqualify it from the date heuristics.
    • isExcelLocalDate

      public boolean isExcelLocalDate()
      Returns whether the value looks like an Excel serial date.
    • isExcelLocalDateTime

      public boolean isExcelLocalDateTime()
      Returns whether the value looks like an Excel serial date/time.
    • naturalDateSplit

      public String[] naturalDateSplit()
      Splits a natural-language date into three chronological fields.
    • parseThreeNumberGroups

      public int[] parseThreeNumberGroups()
      Parses three numeric groups from the source text.
    • toLocalDate

      public LocalDate toLocalDate(DateFormat format)
      Converts the captured text to a local date using the supplied format.
      Parameters:
      format - date token order
      Returns:
      parsed local date or null