public class TimePeriod extends Time
Time.NilReason, Time.RelativePosition, Time.TimeFormat, Time.TimeIndeterminateValue
Modifier and Type | Field and Description |
---|---|
private org.joda.time.Period |
duration
duration value
|
private org.joda.time.DateTime |
end
end Date of timePeriod
|
private Time.TimeIndeterminateValue |
endIndet
indeterminate position of endPosition
|
private String |
interval
interval value
|
private static org.slf4j.Logger |
LOGGER
logger
|
private static long |
serialVersionUID
serial number
|
private org.joda.time.DateTime |
start
start Date of timePeriod
|
private Time.TimeIndeterminateValue |
startIndet
indeterminate position of startPosition
|
Constructor and Description |
---|
TimePeriod()
default constructor
|
TimePeriod(Date start,
Date end)
Constructor using Java
Date s, 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,
Time.TimeIndeterminateValue startIndet,
org.joda.time.DateTime end,
Time.TimeIndeterminateValue endIndet)
constructor
|
TimePeriod(org.joda.time.DateTime start,
Time.TimeIndeterminateValue startIndet,
org.joda.time.DateTime end,
Time.TimeIndeterminateValue endIndet,
String duration,
String id)
standard constructor
|
TimePeriod(Object start,
Object end)
Constructor using Java
Object s, setting unknown indeterminate
values if null |
TimePeriod(TimeInstant startTime,
TimeInstant endTime)
Constructor using
TimeInstant s |
Modifier and Type | Method and Description |
---|---|
private void |
checkTimeFormat(Time.TimeFormat timeFormat)
Checks this timeFormat with passed
|
int |
compareTo(Time o) |
boolean |
equals(Object obj) |
void |
extendToContain(Collection<Time> times)
Extend TimePeriod to contain Collection
|
void |
extendToContain(org.joda.time.DateTime time)
Extend TimePeriod to contain DateTime.
|
void |
extendToContain(Time time)
Extend TimePeriod to contain ISosTime
|
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
|
Time.TimeIndeterminateValue |
getEndIndet()
Get end indet time
|
TimePosition |
getEndTimePosition()
Get TimePosition for end.
|
String |
getInterval()
Get interval
|
org.joda.time.DateTime |
getStart()
Get start time
|
Time.TimeIndeterminateValue |
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(Time.TimeIndeterminateValue endIndet)
Set end indet time
|
void |
setInterval(String interval)
Set interval
|
void |
setStart(org.joda.time.DateTime start)
Set start time
|
void |
setStartIndet(Time.TimeIndeterminateValue startIndet)
Set start indet time
|
String |
toString() |
getGmlId, getNilReason, getReference, getTimeFormat, isNilReasonEqualTo, isReferenced, isSetGmlId, isSetNilReason, isSetReference, isSetTimeFormat, resolveDateTime, setGmlId, setNilReason, setReference, setTimeFormat
private static final org.slf4j.Logger LOGGER
private static final long serialVersionUID
private org.joda.time.DateTime start
private Time.TimeIndeterminateValue startIndet
private org.joda.time.DateTime end
private Time.TimeIndeterminateValue endIndet
private org.joda.time.Period duration
private String interval
public TimePeriod()
public 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, Time.TimeIndeterminateValue startIndet, org.joda.time.DateTime end, Time.TimeIndeterminateValue 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, Time.TimeIndeterminateValue startIndet, org.joda.time.DateTime end, Time.TimeIndeterminateValue 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 formatParseException
- if parsing the time strings of start or end into
java.util.Date failedpublic TimePeriod(TimeInstant startTime, TimeInstant endTime)
TimeInstant
sstartTime
- Start TimeInstantendTime
- End TimeInstantParseException
public TimePeriod(Date start, Date end)
Date
s, 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 org.joda.time.DateTime resolveStart()
public void setStart(org.joda.time.DateTime start)
start
- The start to set.public org.joda.time.DateTime getEnd()
public org.joda.time.DateTime resolveEnd()
public void setEnd(org.joda.time.DateTime end)
end
- The end to set.public Time.TimeIndeterminateValue getStartIndet()
public void setStartIndet(Time.TimeIndeterminateValue startIndet)
startIndet
- The startIndet to set.public Time.TimeIndeterminateValue getEndIndet()
public void setEndIndet(Time.TimeIndeterminateValue endIndet)
endIndet
- The endIndet to set.public String getInterval()
public void setInterval(String interval)
interval
- public TimePosition getStartTimePosition()
public TimePosition getEndTimePosition()
public void extendToContain(Collection<Time> times)
times
- public void extendToContain(Time time)
time
- To contain Time
public void extendToContain(TimePeriod period)
TimePeriod
period
- To contain TimePeriod
public void extendToContain(TimeInstant instant)
TimeInstant
instant
- To contain TimeInstant
public void extendToContain(org.joda.time.DateTime time)
time
- public boolean isWithin(TimePeriod otherTimePeriod)
otherTimePeriod
- Potentially containing TimePeriodprivate void checkTimeFormat(Time.TimeFormat timeFormat)
timeFormat
- TimeFormat to check with localpublic int compareTo(Time o)
public boolean isEmpty()
Time
isEmpty
in class Time
isSetStart()
,
isSetEnd()
public boolean isSetStart()
isEmpty()
,
isSetEnd()
public boolean isSetStartIndeterminateValue()
public boolean isSetEndIndeterminateValue()
public boolean isSetEnd()
isSetStart()
,
isEmpty()
Copyright © 2012-2015 52north.org. All Rights Reserved.