org.apache.myfaces.custom.schedule.model
Class Interval
java.lang.Object
org.apache.myfaces.custom.schedule.model.Interval
- All Implemented Interfaces:
- Serializable, Comparable
- Direct Known Subclasses:
- HalfHourInterval
public class Interval
- extends Object
- implements Serializable, Comparable
This class represents a period of time, which may be given a label.
An interval is inclusive of the start time, but excludes the end time.
- Since:
- 1.1.7
- Version:
- $Revision: 371736 $
- Author:
- Peter Mahoney
- See Also:
- Serialized Form
Interval
public Interval(String label,
Date startTime,
Date endTime)
getLabel
public String getLabel()
setLabel
public void setLabel(String label)
getStartTime
public Date getStartTime()
setStartTime
public void setStartTime(Date startTime)
getEndTime
public Date getEndTime()
setEndTime
public void setEndTime(Date endTime)
containsDate
public boolean containsDate(Date clickedDate)
compareTo
public int compareTo(Object o)
- Specified by:
compareTo
in interface Comparable
after
public boolean after(Interval last)
getStartHours
public int getStartHours(TimeZone timeZone)
getStartMinutes
public int getStartMinutes(TimeZone timeZone)
getDuration
public long getDuration()
isEquivalent
public boolean isEquivalent(Interval other)
Intervals are equivalent if their label is the same and they begin and end
at the same time of day.
- Parameters:
other
- the interval to compare with
- Returns:
- true, if this interval is equivalent to the given interval
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.