Class FormatPattern
java.lang.Object
org.apache.calcite.util.format.postgresql.format.FormatPattern
- Direct Known Subclasses:
AmPmFormatPattern,BcAdFormatPattern,DayOfWeekFormatPattern,MonthFormatPattern,NumberFormatPattern,RomanNumeralsFormatPattern,TimeZoneFormatPattern,TimeZoneHoursFormatPattern,TimeZoneMinutesFormatPattern,TimeZoneOffsetFormatPattern,YearWithCommasFormatPattern
A single component of a date/time format pattern such as YYYY or MI. Each
component may have some flags applied. If the flags are not used by a component,
then they are ignored.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFormatPattern(String pattern) Base class constructor that stores the pattern. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CompiledPatternbuildCompiledPattern(Set<PatternModifier> modifiers) Creates a new instance of the compiled version of this date/time component.compilePattern(String formatString, ParsePosition formatParsePosition) Creates the compiled version of the parsed date/time component along with any flags that it had.
-
Field Details
-
pattern
-
-
Constructor Details
-
FormatPattern
Base class constructor that stores the pattern.- Parameters:
pattern- the date/time component taht this FormatPattern represents
-
-
Method Details
-
compilePattern
public CompiledPattern compilePattern(String formatString, ParsePosition formatParsePosition) throws ParseException Creates the compiled version of the parsed date/time component along with any flags that it had. It is expected that the formatString has the date/time component (with its flags) at the position indicated in formatParsePosition.- Parameters:
formatString- the full date/time format stringformatParsePosition- starting position in formatString with this pattern is located- Returns:
- the compiled version of the parsed date/time component
- Throws:
ParseException- If the date/time format component was not found
-
buildCompiledPattern
Creates a new instance of the compiled version of this date/time component.- Parameters:
modifiers- the set of flags that were parsed- Returns:
- a new instance of the compiled version of this date/time component
-
getPattern
-