biz.onixs.fix.scheduler
Enum DayOfWeek

java.lang.Object
  extended by java.lang.Enum<DayOfWeek>
      extended by biz.onixs.fix.scheduler.DayOfWeek
All Implemented Interfaces:
Serializable, Comparable<DayOfWeek>

public enum DayOfWeek
extends Enum<DayOfWeek>

Day of Week.
The first day of week is Monday which numeric value is 1 and short name is "MON".
The last day of week is Sunday which numeric value is 7 and short name is "SUN".


Enum Constant Summary
FRIDAY
           
MONDAY
           
SATURDAY
           
SUNDAY
           
THURSDAY
           
TUESDAY
           
WEDNESDAY
           
 
Method Summary
static DayOfWeek fromNumber(int value)
          Returns day of week by numeric value.
static DayOfWeek fromStringIgnoreCase(String name)
          Returns day of week by full string name.
The full string name is case insensitive.
 DayOfWeek getNextDay()
          Returns next day of week.
The week is cycled, i.e.
 int getNumber()
          Returns numeric value.
It is 1 for Monday and 7 for Sunday.
 String getShortName()
          Returns short (3 letters) name in the uppercase.
static DayOfWeek getToday()
          Returns today day of week.
 boolean isBetween(DayOfWeek firstDay, DayOfWeek lastDay)
          Returns whether the day of week is in the specified interval.
The week is cycled, i.e.
static DayOfWeek valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DayOfWeek[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MONDAY

public static final DayOfWeek MONDAY

TUESDAY

public static final DayOfWeek TUESDAY

WEDNESDAY

public static final DayOfWeek WEDNESDAY

THURSDAY

public static final DayOfWeek THURSDAY

FRIDAY

public static final DayOfWeek FRIDAY

SATURDAY

public static final DayOfWeek SATURDAY

SUNDAY

public static final DayOfWeek SUNDAY
Method Detail

values

public static DayOfWeek[] 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 (DayOfWeek c : DayOfWeek.values())
    System.out.println(c);

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

valueOf

public static DayOfWeek 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

getToday

public static DayOfWeek getToday()
Returns today day of week.

Returns:
today day of week

getShortName

public String getShortName()
Returns short (3 letters) name in the uppercase.

Returns:
short name

getNextDay

public DayOfWeek getNextDay()
Returns next day of week.
The week is cycled, i.e. Monday is the next day after Sunday.

Returns:
next day of week

getNumber

public int getNumber()
Returns numeric value.
It is 1 for Monday and 7 for Sunday.

Returns:
numeric value

fromStringIgnoreCase

public static DayOfWeek fromStringIgnoreCase(String name)
Returns day of week by full string name.
The full string name is case insensitive.

Parameters:
name - full string name, i.g. Monday
Returns:
day of week
Throws:
IllegalArgumentException - if string name is unexpected

fromNumber

public static DayOfWeek fromNumber(int value)
Returns day of week by numeric value.

Parameters:
value - numeric value
Returns:
day of week
Throws:
IllegalArgumentException - if value is unexpected

isBetween

public boolean isBetween(DayOfWeek firstDay,
                         DayOfWeek lastDay)
Returns whether the day of week is in the specified interval.
The week is cycled, i.e. Sunday is between Saturday and Monday.

Parameters:
firstDay - interval start
lastDay - interval end
Returns:
whether the day of week is in the specified interval


Copyright © 2005-2012 Onix Solutions. All Rights Reserved.