public class TimePeriod extends Object implements ITimePeriod
Modifier and Type | Field and Description |
---|---|
static String |
PERIOD_PATTERN |
Constructor and Description |
---|
TimePeriod(ITimePosition currentStart,
ITimePosition currentEnd) |
TimePeriod(ITimePosition currentStart,
ITimePosition currentEnd,
ITimeResolution currentResolution) |
TimePeriod(String period) |
TimePeriod(String begin,
String end)
Constructs a TimePeriod without a resolution.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(ITimePeriod timePeriod)
proofs whether timePeriod is contained in this TimePeriod.
|
boolean |
contains(ITimePosition timePos)
proofs whether timePosition is contained in this TimePeriod.
|
boolean |
equals(Object obj) |
ITimePosition |
getEnd() |
ITimeResolution |
getResolution() |
ITimePosition |
getStart() |
int |
hashCode() |
boolean |
isResolutionSet() |
void |
setDefaultResolution(String resolution)
Sets a default resolution if the resolution has not been set yet in any other method.
|
String |
toISO8601Format() |
String |
toString() |
public static final String PERIOD_PATTERN
public TimePeriod(String begin, String end)
begin
- a String representing the startend
- a String representing the endpublic TimePeriod(ITimePosition currentStart, ITimePosition currentEnd, ITimeResolution currentResolution)
currentStart
- the start of the periodcurrentEnd
- the end of the periodcurrentResolution
- the resolution of the periodpublic TimePeriod(String period)
period
- a String using ISO 8601 compliant pattern that represents an time periodpublic TimePeriod(ITimePosition currentStart, ITimePosition currentEnd)
currentStart
- the start of the periodcurrentEnd
- the end of the periodpublic ITimePosition getStart()
getStart
in interface ITimePeriod
public ITimePosition getEnd()
getEnd
in interface ITimePeriod
public ITimeResolution getResolution()
getResolution
in interface ITimePeriod
public void setDefaultResolution(String resolution)
resolution
- The resolution to setIllegalArgumentException
- if the String could not be parsed to an TimeResolution
.TimeResolution.TimeResolution(String)
public boolean isResolutionSet()
public String toISO8601Format()
toISO8601Format
in interface ITime
public String toString()
public boolean contains(ITimePeriod timePeriod)
contains
in interface ITimePeriod
public boolean contains(ITimePosition timePos)
contains
in interface ITimePeriod
Copyright © 2012–2017 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.