|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.misc.PropertyObservableBase
de.jaret.util.date.IntervalImpl
public class IntervalImpl
Simple Implementation of an interval. Listens on property changes on the begin and end date. However it is better practice to use the JaretDate like an immutable type most of the time.
| Field Summary | |
|---|---|
protected JaretDate |
_begin
begin date. |
protected JaretDate |
_end
end date. |
| Fields inherited from class de.jaret.util.misc.PropertyObservableBase |
|---|
_propertyChangeSupport |
| Fields inherited from interface de.jaret.util.date.Interval |
|---|
PROP_BEGIN, PROP_END |
| Constructor Summary | |
|---|---|
IntervalImpl()
Default constructor leaving the interval uninitialized. |
|
IntervalImpl(JaretDate from,
JaretDate to)
Construct a date with begin and 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. |
static boolean |
containsNonIncluding(Interval interval,
JaretDate date)
Check whether a given date is contained in the interval not including the exact boundaries. |
static boolean |
containsStatic(Interval interval,
JaretDate date)
Static helper, check whether a dat eis included in an 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. |
static boolean |
intersect(Interval i1,
Interval i2)
Helper method determing if two intervals intersect. |
static boolean |
intersectNonIncluding(Interval i1,
Interval i2)
Static helper method, check intersection not including the interval edges. |
boolean |
intersects(Interval interval)
Check whether this intersects the given interval. |
void |
propertyChange(PropertyChangeEvent evt)
check begin and end instances. |
void |
setBegin(JaretDate begin)
Set the begin timestamp of the interval. |
void |
setEnd(JaretDate end)
Set the end timestamp of the interval. |
String |
toString()
|
| Methods inherited from class de.jaret.util.misc.PropertyObservableBase |
|---|
addPropertyChangeListener, firePropertyChange, isRealModification, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.jaret.util.misc.PropertyObservable |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
protected JaretDate _begin
protected JaretDate _end
| Constructor Detail |
|---|
public IntervalImpl(JaretDate from,
JaretDate to)
from - begin date (will be copied)to - end date (will be copied)public IntervalImpl()
| Method Detail |
|---|
public JaretDate getBegin()
getBegin in interface Intervalpublic JaretDate getEnd()
getEnd in interface Intervalpublic void setBegin(JaretDate begin)
setBegin in interface Intervalbegin - the begin timestamp to be set.public void setEnd(JaretDate end)
setEnd in interface Intervalend - the end timestamp to be set.public boolean contains(JaretDate date)
contains in interface Intervaldate - date to be checked
public boolean contains(Interval interval)
contains in interface Intervalinterval - interval to check
true if the interval is completely contained in the interval
public static boolean containsStatic(Interval interval,
JaretDate date)
interval - intervaldate - date to check for inclusion
public int getSeconds()
getSeconds in interface Intervalpublic String toString()
toString in class Objectpublic boolean intersects(Interval interval)
intersects in interface Intervalinterval - interval to be checked for intersection.
public static boolean intersect(Interval i1,
Interval i2)
i1 - interval1i2 - interval2
public static boolean intersectNonIncluding(Interval i1,
Interval i2)
i1 - interval 1i2 - interval 2
public static boolean containsNonIncluding(Interval interval,
JaretDate date)
interval - intervaldate - date to be checked
public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||