net.fortuna.ical4j.model
Class WeekDay

java.lang.Object
  extended by net.fortuna.ical4j.model.WeekDay
All Implemented Interfaces:
java.io.Serializable

public class WeekDay
extends java.lang.Object
implements java.io.Serializable

$Id: WeekDay.java,v 1.11 2008/12/16 12:34:52 fortuna Exp $ Created: 19/12/2004 Defines a day of the week with a possible offset related to a MONTHLY or YEARLY occurrence.

Author:
Ben Fortuna
See Also:
Serialized Form

Field Summary
static WeekDay FR
           
static WeekDay MO
           
static WeekDay SA
           
static WeekDay SU
           
static WeekDay TH
           
static WeekDay TU
           
static WeekDay WE
           
 
Constructor Summary
WeekDay(java.lang.String value)
           
WeekDay(java.lang.String day, int offset)
           
WeekDay(WeekDay weekDay, int offset)
          Constructs a new weekday instance based on the specified instance and offset.
 
Method Summary
 boolean equals(java.lang.Object arg0)
          Uses ObjectUtils to test equality.
static int getCalendarDay(WeekDay weekday)
          Returns the corresponding java.util.Calendar.DAY_OF_WEEK constant for the specified WeekDay.
 java.lang.String getDay()
           
static WeekDay getDay(int calDay)
          Returns the corresponding day constant to the specified java.util.Calendar.DAY_OF_WEEK property.
static WeekDay getMonthlyOffset(java.util.Calendar cal)
          Returns a weekday/offset representation of the specified calendar.
static WeekDay getNegativeMonthlyOffset(java.util.Calendar cal)
          Returns a weekday/negative offset representation of the specified calendar.
 int getOffset()
           
static WeekDay getWeekDay(java.util.Calendar cal)
          Returns a weekday representation of the specified calendar.
 int hashCode()
          Uses HashCodeBuilder to build hashcode.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SU

public static final WeekDay SU

MO

public static final WeekDay MO

TU

public static final WeekDay TU

WE

public static final WeekDay WE

TH

public static final WeekDay TH

FR

public static final WeekDay FR

SA

public static final WeekDay SA
Constructor Detail

WeekDay

public WeekDay(java.lang.String value)
Parameters:
value -

WeekDay

public WeekDay(java.lang.String day,
               int offset)
Parameters:
day -
offset -

WeekDay

public WeekDay(WeekDay weekDay,
               int offset)
Constructs a new weekday instance based on the specified instance and offset.

Parameters:
weekDay -
offset -
Method Detail

getDay

public final java.lang.String getDay()
Returns:
Returns the day.

getOffset

public final int getOffset()
Returns:
Returns the offset.

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

getWeekDay

public static final WeekDay getWeekDay(java.util.Calendar cal)
Returns a weekday representation of the specified calendar.

Parameters:
cal - a calendar (java.util)
Returns:
a weekday instance representing the specified calendar

getMonthlyOffset

public static final WeekDay getMonthlyOffset(java.util.Calendar cal)
Returns a weekday/offset representation of the specified calendar.

Parameters:
cal - a calendar (java.util)
Returns:
a weekday instance representing the specified calendar

getNegativeMonthlyOffset

public static final WeekDay getNegativeMonthlyOffset(java.util.Calendar cal)
Returns a weekday/negative offset representation of the specified calendar.

Parameters:
cal - a calendar (java.util)
Returns:
a weekday instance representing the specified calendar

getDay

public static WeekDay getDay(int calDay)
Returns the corresponding day constant to the specified java.util.Calendar.DAY_OF_WEEK property.

Parameters:
calDay - a property value of java.util.Calendar.DAY_OF_WEEK
Returns:
a string, or null if an invalid DAY_OF_WEEK property is specified

getCalendarDay

public static int getCalendarDay(WeekDay weekday)
Returns the corresponding java.util.Calendar.DAY_OF_WEEK constant for the specified WeekDay.

Parameters:
weekday -
Returns:

equals

public final boolean equals(java.lang.Object arg0)
Uses ObjectUtils to test equality.

Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Uses HashCodeBuilder to build hashcode.

Overrides:
hashCode in class java.lang.Object


Copyright © 2004-2009 Modularity. All Rights Reserved.