Serializable
public class PeriodList<T extends Temporal> extends Object implements Serializable
Instant
)
NOTE: By implementing the java.util.SortedSet
interface period lists will always be sorted according
to natural ordering.Constructor | Description |
---|---|
PeriodList() |
Default constructor.
|
PeriodList(Collection<Period<T>> periods) |
|
PeriodList(Collection<Period<T>> periods,
CalendarDateFormat dateFormat) |
|
PeriodList(CalendarDateFormat dateFormat) |
Modifier and Type | Method | Description |
---|---|---|
PeriodList<T> |
add(Period<T> period) |
Add a period to the list.
|
PeriodList<T> |
add(PeriodList<T> periods) |
A convenience method that combines all the periods in the specified list to
this list.
|
PeriodList<T> |
addAll(Collection<Period<T>> arg0) |
|
boolean |
equals(Object o) |
|
Set<Period<T>> |
getPeriods() |
|
int |
hashCode() |
|
PeriodList<T> |
normalise() |
Returns a normalised version of this period list.
|
static <T extends Temporal> |
parse(String aValue) |
Parses the specified string representation to create a list of periods.
|
static <T extends Temporal> |
parse(String aValue,
CalendarDateFormat calendarDateFormat) |
|
PeriodList<T> |
remove(Object period) |
Remove a period from the list.
|
PeriodList<T> |
subtract(PeriodList<T> subtractions) |
Subtracts the intersection of this list with the specified list of
periods from this list and returns the results as a new period list.
|
String |
toString() |
|
String |
toString(ZoneId zoneId) |
public PeriodList()
public PeriodList(CalendarDateFormat dateFormat)
public PeriodList(Collection<Period<T>> periods)
public PeriodList(Collection<Period<T>> periods, CalendarDateFormat dateFormat)
public static <T extends Temporal> PeriodList<T> parse(String aValue)
aValue
- a string representation of a list of periodsDateTimeParseException
- thrown when an invalid string representation of a period list
is providedpublic static <T extends Temporal> PeriodList<T> parse(String aValue, CalendarDateFormat calendarDateFormat)
public final PeriodList<T> add(Period<T> period)
period
- the period to addList.add(java.lang.Object)
public final PeriodList<T> remove(Object period)
period
- the period to removeList.remove(java.lang.Object)
public final PeriodList<T> normalise()
public final PeriodList<T> add(PeriodList<T> periods)
periods
- a list of periods to addpublic final PeriodList<T> subtract(PeriodList<T> subtractions)
subtractions
- a list of periods to subtract from this listpublic PeriodList<T> addAll(Collection<Period<T>> arg0)