public class TimePeriod extends Time
Time.NilReason, Time.RelativePosition, Time.TimeFormat| Constructor and Description |
|---|
TimePeriod()
default constructor
|
TimePeriod(java.util.Date start,
java.util.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,
java.lang.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,
java.lang.String duration,
java.lang.String id)
standard constructor
|
TimePeriod(org.joda.time.Interval interval)
Creates a new
TimePeriod from an Interval. |
TimePeriod(java.lang.Object start,
java.lang.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(java.lang.Object obj) |
void |
extendToContain(java.util.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.
|
java.lang.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?
|
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(java.lang.String interval)
Set interval
|
void |
setStart(org.joda.time.DateTime start)
Set start time
|
void |
setStartIndet(IndeterminateValue startIndet)
Set start indet time
|
java.lang.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,
java.lang.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,
java.lang.String duration,
java.lang.String id)
throws java.text.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 idjava.text.ParseException - 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(java.util.Date start,
java.util.Date end)
Dates, setting unknown indeterminate
values if nullstart - start Dateend - end Datepublic TimePeriod(java.lang.Object start,
java.lang.Object end)
Objects, setting unknown indeterminate
values if nullstart - start Objectend - end Objectpublic 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 java.lang.String getInterval()
public void setInterval(java.lang.String interval)
interval - the intervalpublic TimePosition getStartTimePosition()
public TimePosition getEndTimePosition()
public void extendToContain(java.util.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 java.lang.String toString()
toString in class java.lang.Objectpublic 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()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectCopyright © 2015–2018 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.