Modifier and Type | Field and Description |
---|---|
protected java.util.Date |
endDate |
protected java.lang.Object |
linkedElement |
protected java.util.Date |
startDate |
Constructor and Description |
---|
Interval(java.util.Date startDate,
java.util.Date endDate,
java.lang.Object linkedElement) |
Interval(Interval interval) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Interval interval) |
boolean |
equals(java.lang.Object obj) |
java.util.Date |
getEndDate() |
java.lang.Object |
getLinkedElement() |
java.util.Date |
getStartDate() |
int |
hashCode() |
void |
merge(Interval interval)
merge two interval which overlaps in one
|
boolean |
overlapWith(Interval other)
Indicates if the two interval overlaps or not (greedy overlap @see
DateUtil.overlapWith(Date, Date, Date, Date, boolean) |
boolean |
overlapWith(Interval other,
boolean greedy)
Indicates if the two interval overlaps or not (greedy overlap @see
DateUtil.overlapWith(Date, Date, Date, Date, boolean) |
void |
setEndDate(java.util.Date endDate) |
void |
setLinkedElement(java.lang.Object linkedElement) |
void |
setStartDate(java.util.Date startDate) |
java.lang.String |
toString() |
protected java.util.Date startDate
protected java.util.Date endDate
protected java.lang.Object linkedElement
public Interval(java.util.Date startDate, java.util.Date endDate, java.lang.Object linkedElement)
public Interval(Interval interval)
public java.lang.Object getLinkedElement()
public void setLinkedElement(java.lang.Object linkedElement)
linkedElement
- the linkedElement to setpublic java.util.Date getStartDate()
public void setStartDate(java.util.Date startDate)
startDate
- the startDate to setpublic java.util.Date getEndDate()
public void setEndDate(java.util.Date endDate)
endDate
- the endDate to setpublic boolean overlapWith(Interval other)
DateUtil.overlapWith(Date, Date, Date, Date, boolean)
other
- the other Interval
public boolean overlapWith(Interval other, boolean greedy)
DateUtil.overlapWith(Date, Date, Date, Date, boolean)
other
- the other Interval
greedy
- indicates if the overlap is greedy or notpublic int compareTo(Interval interval)
compareTo
in interface java.lang.Comparable<Interval>
public void merge(Interval interval)
interval
- the interval to merge intopublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2001-2010 Jalios SA. All Rights Reserved.