public class TimePeriod extends Time
Time.NilReason, Time.RelativePosition, Time.TimeFormat| Constructor and Description |
|---|
TimePeriod()
default constructor
|
TimePeriod(Date start,
Date end)
Constructor using Java
Dates, setting unknown indeterminate
values if null |
TimePeriod(org.joda.time.DateTime start,
org.joda.time.DateTime end)
constructor with start and end date as parameters
|
TimePeriod(org.joda.time.DateTime start,
org.joda.time.DateTime end,
String id)
constructor
|
TimePeriod(org.joda.time.DateTime start,
IndeterminateValue startIndet,
org.joda.time.DateTime end,
IndeterminateValue endIndet)
constructor
|
TimePeriod(org.joda.time.DateTime start,
IndeterminateValue startIndet,
org.joda.time.DateTime end,
IndeterminateValue endIndet,
String duration,
String id)
standard constructor
|
TimePeriod(org.joda.time.Interval interval)
Creates a new
TimePeriod from an Interval. |
TimePeriod(Object start,
Object end)
Constructor using Java
Objects, setting unknown indeterminate
values if null |
TimePeriod(TimeInstant startTime,
TimeInstant endTime)
Constructor using
TimeInstants |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Time o) |
boolean |
equals(Object obj) |
void |
extendToContain(Collection<Time> times)
Extend TimePeriod to contain provided collection of
Times |
void |
extendToContain(org.joda.time.DateTime time)
Extend TimePeriod to contain DateTime.
|
void |
extendToContain(Time time)
Extend TimePeriod to contain provided
Time |
void |
extendToContain(TimeInstant instant)
Extend TimePeriod to contain
TimeInstant |
void |
extendToContain(TimePeriod period)
Extend TimePeriod to contain another
TimePeriod |
org.joda.time.Period |
getDuration()
Get duration
|
org.joda.time.DateTime |
getEnd()
Get end time
|
IndeterminateValue |
getEndIndet()
Get end indet time
|
TimePosition |
getEndTimePosition()
Get TimePosition for end.
|
String |
getInterval()
Get interval
|
org.joda.time.DateTime |
getStart()
Get start time
|
IndeterminateValue |
getStartIndet()
Get start indet time
|
TimePosition |
getStartTimePosition()
Get TimePosition for start.
|
int |
hashCode() |
boolean |
isEmpty()
Check if time is empty
|
boolean |
isSetEnd() |
boolean |
isSetEndIndeterminateValue() |
boolean |
isSetStart() |
boolean |
isSetStartIndeterminateValue() |
boolean |
isWithin(TimePeriod otherTimePeriod)
Is this TimePeriod contained by another TimePeriod? Equal start/end times
are considered to be containing, as are equal indeterminate times.
|
org.joda.time.DateTime |
resolveEnd()
Get end time, resolving indeterminate value if start is null
|
org.joda.time.DateTime |
resolveStart()
Get start time, resolving indeterminate value if start is null
|
void |
setDuration(org.joda.time.Period duration)
Set duration
|
void |
setEnd(org.joda.time.DateTime end)
Set end time
|
void |
setEndIndet(IndeterminateValue endIndet)
Set end indet time
|
void |
setInterval(String interval)
Set interval
|
void |
setStart(org.joda.time.DateTime start)
Set start time
|
void |
setStartIndet(IndeterminateValue startIndet)
Set start indet time
|
String |
toString() |
getGmlId, getNilReason, getReference, getTimeFormat, isNilReasonEqualTo, isReferenced, isSetGmlId, isSetNilReason, isSetReference, isSetTimeFormat, resolveDateTime, setGmlId, setNilReason, setReference, setTimeFormatpublic TimePeriod()
public TimePeriod(org.joda.time.Interval interval)
TimePeriod from an Interval.interval - the intervalpublic TimePeriod(org.joda.time.DateTime start,
org.joda.time.DateTime end)
start - start date of the time periodend - end date of the time periodpublic TimePeriod(org.joda.time.DateTime start,
org.joda.time.DateTime end,
String id)
start - start date of the time periodend - end date of the time periodid - GML idpublic TimePeriod(org.joda.time.DateTime start,
IndeterminateValue startIndet,
org.joda.time.DateTime end,
IndeterminateValue endIndet)
start - start date of the time periodstartIndet - indeterminate time position of startend - end date of the time periodendIndet - indeterminate time value of end positionpublic TimePeriod(org.joda.time.DateTime start,
IndeterminateValue startIndet,
org.joda.time.DateTime end,
IndeterminateValue endIndet,
String duration,
String id)
throws ParseException
start - timeString of start position in ISO8601 formatstartIndet - indeterminate time position of startend - timeString of end position in ISO8601 formatendIndet - indeterminate time value of end positionduration - duration in ISO8601 formatid - the optional GML idParseException - if parsing the time strings of start or end into
java.util.Date failedpublic TimePeriod(TimeInstant startTime, TimeInstant endTime)
TimeInstantsstartTime - Start TimeInstantendTime - End TimeInstantpublic TimePeriod(Date start, Date end)
Dates, setting unknown indeterminate
values if nullstart - start Dateend - end Datepublic org.joda.time.Period getDuration()
public void setDuration(org.joda.time.Period duration)
duration - The duration to set.public org.joda.time.DateTime getStart()
public void setStart(org.joda.time.DateTime start)
start - The start to set.public org.joda.time.DateTime resolveStart()
public org.joda.time.DateTime getEnd()
public void setEnd(org.joda.time.DateTime end)
end - The end to set.public org.joda.time.DateTime resolveEnd()
public IndeterminateValue getStartIndet()
public void setStartIndet(IndeterminateValue startIndet)
startIndet - The startIndet to set.public IndeterminateValue getEndIndet()
public void setEndIndet(IndeterminateValue endIndet)
endIndet - The endIndet to set.public String getInterval()
public void setInterval(String interval)
interval - the intervalpublic TimePosition getStartTimePosition()
public TimePosition getEndTimePosition()
public void extendToContain(Collection<Time> times)
Timestimes - the times to containpublic void extendToContain(Time time)
Timetime - To contain Timepublic void extendToContain(TimePeriod period)
TimePeriodperiod - To contain TimePeriodpublic void extendToContain(TimeInstant instant)
TimeInstantinstant - To contain TimeInstantpublic void extendToContain(org.joda.time.DateTime time)
time - the time to containpublic boolean isWithin(TimePeriod otherTimePeriod)
otherTimePeriod - Potentially containing TimePeriodpublic int compareTo(Time o)
public boolean isEmpty()
TimeisEmpty in class TimeisSetStart(),
isSetEnd()public boolean isSetStart()
isEmpty(),
isSetEnd()public boolean isSetStartIndeterminateValue()
public boolean isSetEndIndeterminateValue()
public boolean isSetEnd()
isSetStart(),
isEmpty()Copyright © 2015–2021 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.