Package net.time4j.range
Class CalendarPeriod.Factory<T>
java.lang.Object
net.time4j.range.CalendarPeriod.Parser<T>
net.time4j.range.CalendarPeriod.Factory<T>
- Type Parameters:
T
- generic type of timepoints on the underlying timeline
- Enclosing class:
- CalendarPeriod<T>
Serves for the creation of generic calendar intervals on a timeline.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a closed interval between given calendrical timepoints.parse(CharSequence text, ChronoParser<T> parser, String intervalPattern)
Interpretes given text as interval using given interval pattern.Methods inherited from class net.time4j.range.CalendarPeriod.Parser
parse
-
Method Details
-
between
Creates a closed interval between given calendrical timepoints.
- Parameters:
start
- the start of intervalend
- the end of interval (inclusive)- Returns:
- new calendrical interval
-
parse
public CalendarPeriod<T> parse(CharSequence text, ChronoParser<T> parser, String intervalPattern) throws ParseExceptionDescription copied from class:CalendarPeriod.Parser
Interpretes given text as interval using given interval pattern.
It is also possible to use an or-pattern logic. Example see
DateInterval.parse(String, ChronoParser, String)
.- Overrides:
parse
in classCalendarPeriod.Parser<T>
- Parameters:
text
- text to be parsedparser
- format object for parsing start and end componentsintervalPattern
- interval pattern containing placeholders {0} and {1} (for start and end)- Returns:
- parsed interval (closed if calendrical else half-open)
- Throws:
ParseException
- if the text is not parseable
-