T - generic type of timepoints on the underlying timelinepublic static class SimpleInterval.Factory<T> extends Object
Serves for the creation of generic simple intervals on a timeline.
| Modifier and Type | Method and Description |
|---|---|
SimpleInterval<T> |
between(T start,
T end)
Creates a new interval between given boundaries.
|
SimpleInterval<T> |
parse(CharSequence text,
ChronoParser<T> parser)
Interpretes given text as interval using a localized interval pattern.
|
SimpleInterval<T> |
parse(CharSequence text,
ChronoParser<T> parser,
String intervalPattern)
Interpretes given text as interval using given interval pattern.
|
SimpleInterval<T> |
since(T start)
Creates a new interval since given start.
|
SimpleInterval<T> |
until(T end)
Creates a new interval until given end.
|
public SimpleInterval<T> between(T start, T end)
Creates a new interval between given boundaries.
start - the start of interval (always inclusive)end - the end of interval (inclusive if calendrical else exclusive)public SimpleInterval<T> since(T start)
Creates a new interval since given start.
start - the start of interval (inclusive)public SimpleInterval<T> until(T end)
Creates a new interval until given end.
end - the end of interval (inclusive if calendrical else exclusive)public SimpleInterval<T> parse(CharSequence text, ChronoParser<T> parser) throws ParseException
Interpretes given text as interval using a localized interval pattern.
If given parser does not contain a reference to a locale then the interval pattern "{0}/{1}" will be used.
text - text to be parsedparser - format object for parsing start and end componentsIndexOutOfBoundsException - if given text is emptyParseException - if the text is not parseableparse(CharSequence, ChronoParser, String)public SimpleInterval<T> parse(CharSequence text, ChronoParser<T> parser, String intervalPattern) throws ParseException
Interpretes given text as interval using given interval pattern.
For version v4.21 or later, it is also possible to use an or-pattern logic. Example
see DateInterval.parse(String, ChronoParser, String).
text - text to be parsedparser - format object for parsing start and end componentsintervalPattern - interval pattern containing placeholders {0} and {1} (for start and end)IndexOutOfBoundsException - if given text is emptyParseException - if the text is not parseableCopyright © 2014–2021. All rights reserved.