Package com.jalios.util
Class Interval
java.lang.Object
com.jalios.util.Interval
- All Implemented Interfaces:
Comparable<Interval>
Interval abstraction (2 dates)
- Author:
- ludovic
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleaninthashCode()voidmerge two interval which overlaps in onebooleanoverlapWith(Interval other) Indicates if the two interval overlaps or not (greedy overlap @seeDateUtil.overlapWith(Date, Date, Date, Date, boolean)booleanoverlapWith(Interval other, boolean greedy) Indicates if the two interval overlaps or not (greedy overlap @seeDateUtil.overlapWith(Date, Date, Date, Date, boolean)voidsetEndDate(Date endDate) voidsetLinkedElement(Object linkedElement) voidsetStartDate(Date startDate) toString()
-
Field Details
-
startDate
-
endDate
-
linkedElement
-
-
Constructor Details
-
Interval
-
Interval
-
-
Method Details
-
getLinkedElement
- Returns:
- the linkedElement
-
setLinkedElement
- Parameters:
linkedElement- the linkedElement to set
-
getStartDate
- Returns:
- the startDate
-
setStartDate
- Parameters:
startDate- the startDate to set
-
getEndDate
- Returns:
- the endDate
-
setEndDate
- Parameters:
endDate- the endDate to set
-
overlapWith
Indicates if the two interval overlaps or not (greedy overlap @seeDateUtil.overlapWith(Date, Date, Date, Date, boolean)- Parameters:
other- the otherInterval- Returns:
- true if the interval overlaps, false otherwise
-
overlapWith
Indicates if the two interval overlaps or not (greedy overlap @seeDateUtil.overlapWith(Date, Date, Date, Date, boolean)- Parameters:
other- the otherIntervalgreedy- indicates if the overlap is greedy or not- Returns:
- true if the interval overlaps, false otherwise
-
compareTo
- Specified by:
compareToin interfaceComparable<Interval>
-
merge
merge two interval which overlaps in one- Parameters:
interval- the interval to merge into
-
hashCode
public int hashCode() -
equals
-
toString
-