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 intNOT_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 intcompareTo(Period other)booleancontains(DateTimeZone aDateTimeZone)Returns true if aDateTimeZone is contained in this period.booleanequals(Object aObject)DateTimeZonegetBegin()longgetBeginMillis()TimeZonegetBeginTimeZone()DateTimeZonegetEnd()longgetEndMillis()TimeZonegetEndTimeZone()inthashCode()booleanintersects(Period aPeriod)Returns true if there is an overlap between aPeriod and this period.booleanisBeginNull()booleanisEndNull()voidsetBegin(DateTimeZone newBegin)voidsetBegin(TimeZone newBeginTimeZone, long newBeginMillis)voidsetBeginMillis(long newBeginMillis)voidsetEnd(DateTimeZone newEnd)voidsetEnd(TimeZone newEndTimeZone, long newEndMillis)voidsetEndMillis(long newEndMillis)voidsetTimeZone(TimeZone newTimeZone)StringtoString()
-
-
-
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:
compareToin interfaceComparable<Period>
-
-