org.apache.myfaces.custom.schedule.model
Class Day

java.lang.Object
  extended by org.apache.myfaces.custom.schedule.model.Day
All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
ScheduleDay

public class Day
extends Object
implements Serializable, Comparable

This class represents a day in the Schedule component

Version:
$Revision: 371736 $
Author:
Jurgen Lust (latest modification by $Author: werpu $)
See Also:
Serialized Form

Constructor Summary
Day(Date date)
          Creates a new Day object.
Day(Date date, TimeZone timeZone)
          Creates a new Day object.
 
Method Summary
 void addInterval(String label, Date startTime, Date endTime)
           
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 boolean equalsDate(Date date)
           Check if the specified date is on this day
protected  Calendar getCalendarInstance(Date date)
           
 Date getDate()
           
 Date getDayEnd()
           
 Date getDayStart()
           
 TreeSet getIntervals()
           
 String getSpecialDayName()
           If this day is a holiday of some kind, this gets the name
 int hashCode()
           
 boolean isWorkingDay()
           Is this day a working day?
 void setIntervals(Collection intervals)
          Set user defined intervals during the day.
 void setSpecialDayName(String specialDayName)
           If this day is a holiday of some kind, this sets the name
 void setWorkingDay(boolean workingDay)
           Is this day a working day?
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Day

public Day(Date date)
Creates a new Day object.

Parameters:
date - the date
Throws:
NullPointerException - when the date is null

Day

public Day(Date date,
           TimeZone timeZone)
Creates a new Day object.

Parameters:
date - the date
timeZone - The timezone
Throws:
NullPointerException - when the date is null
Method Detail

getCalendarInstance

protected Calendar getCalendarInstance(Date date)

getDate

public Date getDate()
Returns:
Returns the date.

getDayEnd

public Date getDayEnd()
Returns:
Returns 12PM of this day

getDayStart

public Date getDayStart()
Returns:
Returns 0AM of this day

setSpecialDayName

public void setSpecialDayName(String specialDayName)

If this day is a holiday of some kind, this sets the name

Parameters:
specialDayName - The specialDayName to set.

getSpecialDayName

public String getSpecialDayName()

If this day is a holiday of some kind, this gets the name

Returns:
Returns the specialDayName.

setWorkingDay

public void setWorkingDay(boolean workingDay)

Is this day a working day?

Parameters:
workingDay - The workingDay to set.

isWorkingDay

public boolean isWorkingDay()

Is this day a working day?

Returns:
Returns the workingDay.

getIntervals

public TreeSet getIntervals()
Returns:
A chronologically ordered set of intervals.

setIntervals

public void setIntervals(Collection intervals)
Set user defined intervals during the day.

Parameters:
intervals - A Collection of intervals during the day

addInterval

public void addInterval(String label,
                        Date startTime,
                        Date endTime)

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(Object o)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

equalsDate

public boolean equalsDate(Date date)

Check if the specified date is on this day

Parameters:
date - the date to check
Returns:
if the date is on this day

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.