Package app.babylon.table.transform
Class DateValueFacts
java.lang.Object
app.babylon.table.transform.DateValueFacts
Lightweight facts extracted from a date candidate string.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of alphabetic characters.static DateValueFactsfrom(CharSequence value) Builds date facts from the supplied text.booleanReturns whether the text contains commas.booleanReturns whether the text contains periods.booleanReturns whether the text has token shapes that disqualify it from the date heuristics.booleanReturns whether the text also looks like a decimal number.booleanReturns whether the value looks like an Excel serial date.booleanReturns whether the value looks like an Excel serial date/time.String[]Splits a natural-language date into three chronological fields.booleanReturns whether the stripped text contains digits only.int[]Parses three numeric groups from the source text.intsize()Returns the stripped text length.text()Returns the stripped source text.toLocalDate(DateFormat format) Converts the captured text to a local date using the supplied format.
-
Method Details
-
from
Builds date facts from the supplied text.- Parameters:
value- text to inspect- Returns:
- extracted facts or
null
-
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
Splits a natural-language date into three chronological fields. -
parseThreeNumberGroups
public int[] parseThreeNumberGroups()Parses three numeric groups from the source text. -
toLocalDate
Converts the captured text to a local date using the supplied format.- Parameters:
format- date token order- Returns:
- parsed local date or
null
-