Package com.redwood.scheduler.api.date
Class Period
- java.lang.Object
-
- com.redwood.scheduler.api.date.Period
-
- All Implemented Interfaces:
Comparable<Period>
public class Period extends Object implements Comparable<Period>
Class to define a period in time
-
-
Field Summary
Fields Modifier and Type Field Description static int
NOT_SET
-
Constructor Summary
Constructors Constructor Description Period(DateTimeZone newBegin, DateTimeZone newEnd)
Period(Period newPeriod)
Period(TimeZone newTimeZone, long newBeginMillis, long newEndMillis)
Period(TimeZone newBeginTimeZone, long newBeginMillis, TimeZone newEndTimeZone, long newEndMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Period other)
boolean
contains(DateTimeZone aDateTimeZone)
Returns true if aDateTimeZone is contained in this period.boolean
equals(Object aObject)
DateTimeZone
getBegin()
long
getBeginMillis()
TimeZone
getBeginTimeZone()
DateTimeZone
getEnd()
long
getEndMillis()
TimeZone
getEndTimeZone()
int
hashCode()
boolean
intersects(Period aPeriod)
Returns true if there is an overlap between aPeriod and this period.boolean
isBeginNull()
boolean
isEndNull()
void
setBegin(DateTimeZone newBegin)
void
setBegin(TimeZone newBeginTimeZone, long newBeginMillis)
void
setBeginMillis(long newBeginMillis)
void
setEnd(DateTimeZone newEnd)
void
setEnd(TimeZone newEndTimeZone, long newEndMillis)
void
setEndMillis(long newEndMillis)
void
setTimeZone(TimeZone newTimeZone)
String
toString()
-
-
-
Field Detail
-
NOT_SET
public static final int NOT_SET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Period
public Period(TimeZone newBeginTimeZone, long newBeginMillis, TimeZone newEndTimeZone, long newEndMillis)
-
Period
public Period(TimeZone newTimeZone, long newBeginMillis, long newEndMillis)
-
Period
public Period(DateTimeZone newBegin, DateTimeZone newEnd)
-
Period
public Period(Period newPeriod)
-
-
Method Detail
-
contains
public boolean contains(DateTimeZone aDateTimeZone)
Returns true if aDateTimeZone is contained in this period.- Parameters:
aDateTimeZone
- is the DateTimeZone to test.- Returns:
- true if aDateTimeZone is contained in this period.
-
intersects
public boolean intersects(Period aPeriod)
Returns true if there is an overlap between aPeriod and this period.- Parameters:
aPeriod
- is the period to test.- Returns:
- true if there is an overlap between aPeriod and this period.
-
getEndMillis
public long getEndMillis()
-
getEndTimeZone
public TimeZone getEndTimeZone()
-
getBeginMillis
public long getBeginMillis()
-
getBeginTimeZone
public TimeZone getBeginTimeZone()
-
getEnd
public DateTimeZone getEnd()
-
getBegin
public DateTimeZone getBegin()
-
isBeginNull
public boolean isBeginNull()
-
isEndNull
public boolean isEndNull()
-
setEndMillis
public void setEndMillis(long newEndMillis)
-
setEnd
public void setEnd(TimeZone newEndTimeZone, long newEndMillis)
-
setBeginMillis
public void setBeginMillis(long newBeginMillis)
-
setBegin
public void setBegin(TimeZone newBeginTimeZone, long newBeginMillis)
-
setTimeZone
public void setTimeZone(TimeZone newTimeZone)
-
setEnd
public void setEnd(DateTimeZone newEnd)
-
setBegin
public void setBegin(DateTimeZone newBegin)
-
compareTo
public int compareTo(Period other)
- Specified by:
compareTo
in interfaceComparable<Period>
-
-