de.jaret.util.date
Interface Interval

All Superinterfaces:
PropertyObservable
All Known Implementing Classes:
Event, IntervalImpl

public interface Interval
extends PropertyObservable

Interval with observable properties.

Version:
$Id: Interval.java 875 2009-09-03 22:07:04Z kliem $
Author:
Peter Kliem

Field Summary
static String PROP_BEGIN
          Constant defining the property name for begin.
static String PROP_END
          Constant defining the property name for end.
 
Method Summary
 boolean contains(Interval interval)
          Checks whether an interval is completely contained in the interval.
 boolean contains(JaretDate date)
          Checks whether a given date is contained in the interval.
 JaretDate getBegin()
          Retrieve the begin timestamp of the interval.
 JaretDate getEnd()
          Retrieve the end timestamp of the interval.
 int getSeconds()
          Retrieve the length of the interval in seconds.
 boolean intersects(Interval interval)
          Check whether this intersects the given interval.
 void setBegin(JaretDate begin)
          Set the begin timestamp of the interval.
 void setEnd(JaretDate end)
          Set the end timestamp of the interval.
 
Methods inherited from interface de.jaret.util.misc.PropertyObservable
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

PROP_END

static final String PROP_END
Constant defining the property name for end.

See Also:
Constant Field Values

PROP_BEGIN

static final String PROP_BEGIN
Constant defining the property name for begin.

See Also:
Constant Field Values
Method Detail

setBegin

void setBegin(JaretDate begin)
Set the begin timestamp of the interval.

Parameters:
begin - the begin timestamp to be set.

getBegin

JaretDate getBegin()
Retrieve the begin timestamp of the interval.

Returns:
the begin timestamp of the interval.

setEnd

void setEnd(JaretDate end)
Set the end timestamp of the interval.

Parameters:
end - the end timestamp to be set.

getEnd

JaretDate getEnd()
Retrieve the end timestamp of the interval.

Returns:
the end timestamp of the interval.

contains

boolean contains(JaretDate date)
Checks whether a given date is contained in the interval.

Parameters:
date - date to be checked
Returns:
true if the date is included in the interval

contains

boolean contains(Interval interval)
Checks whether an interval is completely contained in the interval.

Parameters:
interval - interval to check
Returns:
true if the interval is completely contained in the interval

getSeconds

int getSeconds()
Retrieve the length of the interval in seconds.

Returns:
length of the interval in seconds

intersects

boolean intersects(Interval interval)
Check whether this intersects the given interval.

Parameters:
interval - interval to be checked for intersection.
Returns:
true if an intersection exists, false otherwise


Copyright © 2013. All Rights Reserved.