org.deegree.protocol.sos.time
Class TimePeriod

java.lang.Object
  extended by org.deegree.protocol.sos.time.TimePeriod
All Implemented Interfaces:
SamplingTime

public class TimePeriod
extends Object
implements SamplingTime

This class represets a time period between to dates. The period can be extended.

Version:
$Revision: 19378 $, $Date: 2009-08-28 10:26:53 +0200 (Fri, 28 Aug 2009) $
Author:
Oliver Tonnhofer, last edited by: $Author: aionita $

Constructor Summary
TimePeriod()
          Create an empty TimePeriod. getEnd and getBegin will return null before it is extended the frst time.
TimePeriod(Date begin, Date end)
           
 
Method Summary
static TimePeriod createTimePeriod(String isoBegin, String isoEnd, String isoDuration)
          Create a new TimePeriod.
 boolean equals(Object obj)
           
 void extend(Date samplingTime)
          Extend the TimePeriod with the given date.
 void extend(SamplingTime samplingTime)
          Extend the TimePeriod with the given date.
 Date getBegin()
           
 Date getEnd()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimePeriod

public TimePeriod()
Create an empty TimePeriod. getEnd and getBegin will return null before it is extended the frst time.


TimePeriod

public TimePeriod(Date begin,
                  Date end)
Parameters:
begin -
end -
Method Detail

createTimePeriod

public static TimePeriod createTimePeriod(String isoBegin,
                                          String isoEnd,
                                          String isoDuration)
Create a new TimePeriod. One of the values may be null or empty.

If all values are given, the end must be begin+duration.

Parameters:
isoBegin - iso8601 string
isoEnd - iso8601 string
isoDuration - iso8601 duration string
Returns:
a new time period
Throws:
IllegalArgumentException - if more than one value is null or empty, or if begin, end and duration doesn't match

extend

public void extend(Date samplingTime)
Extend the TimePeriod with the given date.

Parameters:
samplingTime -

extend

public void extend(SamplingTime samplingTime)
Extend the TimePeriod with the given date.

Parameters:
samplingTime -

getBegin

public Date getBegin()
Returns:
the begin date

getEnd

public Date getEnd()
Returns:
the end date

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.