Holger's
Java API

com.antelmann.calendar
Enum WeekDay

java.lang.Object
  extended by java.lang.Enum<WeekDay>
      extended by com.antelmann.calendar.WeekDay
All Implemented Interfaces:
Serializable, Comparable<WeekDay>

public enum WeekDay
extends Enum<WeekDay>

represents the days in a week with localized strings

Since:
02.07.2008, 21:35:43
Author:
Holger Antelmann
See Also:
Month

Enum Constant Summary
FRIDAY
           
MONDAY
           
SATURDAY
           
SUNDAY
           
THURSDAY
           
TUESDAY
           
WEDNESDAY
           
 
Method Summary
 boolean appliesTo(Date date)
           
static WeekDay fromDate(Date date)
           
static WeekDay fromDate(Date date, Calendar cal)
           
static WeekDay fromInt(int weekDay)
           
 String getName(Locale l)
           
 int intValue()
          corresponds to the constants used in Calendar
 boolean isWeekend()
           
 Date next(Date date)
          if, for example, this is Monday, this method returns the next Monday seen from the given date.
 Date next(Date date, Calendar cal)
           
 Date previous(Date date)
          if, for example, this is Monday, this method returns the previous Monday seen from the given date.
 Date previous(Date date, Calendar cal)
           
 String toString()
           
static WeekDay valueOf(String name)
          Returns the enum constant of this type with the specified name.
static WeekDay[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MONDAY

public static final WeekDay MONDAY

TUESDAY

public static final WeekDay TUESDAY

WEDNESDAY

public static final WeekDay WEDNESDAY

THURSDAY

public static final WeekDay THURSDAY

FRIDAY

public static final WeekDay FRIDAY

SATURDAY

public static final WeekDay SATURDAY

SUNDAY

public static final WeekDay SUNDAY
Method Detail

values

public static WeekDay[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (WeekDay c : WeekDay.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WeekDay valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isWeekend

public boolean isWeekend()

appliesTo

public boolean appliesTo(Date date)

next

public Date next(Date date)
if, for example, this is Monday, this method returns the next Monday seen from the given date. If the given date already is a Monday, the return value is one week later. The time in day is not altered.


next

public Date next(Date date,
                 Calendar cal)

previous

public Date previous(Date date)
if, for example, this is Monday, this method returns the previous Monday seen from the given date. If the given date already is a Monday, the return value is one week earlier. The time in day is not altered.


previous

public Date previous(Date date,
                     Calendar cal)

intValue

public int intValue()
corresponds to the constants used in Calendar


fromInt

public static WeekDay fromInt(int weekDay)
                       throws IllegalArgumentException
Throws:
IllegalArgumentException

fromDate

public static WeekDay fromDate(Date date)

fromDate

public static WeekDay fromDate(Date date,
                               Calendar cal)

getName

public String getName(Locale l)

toString

public String toString()
Overrides:
toString in class Enum<WeekDay>


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads