de.laliluna.date
Enum Days

java.lang.Object
  extended by java.lang.Enum<Days>
      extended by de.laliluna.date.Days
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Days>

public enum Days
extends java.lang.Enum<Days>

Enum containing the days of a week. It provides methods to convert an int to a enum and back. In addition you can get english abbreviations and the full name of the day name.


Enum Constant Summary
FRI
           
MON
           
SAT
           
SUN
           
THU
           
TUE
           
WED
           
 
Field Summary
static java.lang.String[] names
           
static java.lang.String[] shortNames
           
 
Method Summary
 java.lang.String toName()
           
 java.lang.String toNameShort()
           
static Days valueOf(int day)
          Returns the day of the give int value.
static Days valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Days[] 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

MON

public static final Days MON

TUE

public static final Days TUE

WED

public static final Days WED

THU

public static final Days THU

FRI

public static final Days FRI

SAT

public static final Days SAT

SUN

public static final Days SUN
Field Detail

shortNames

public static final java.lang.String[] shortNames

names

public static final java.lang.String[] names
Method Detail

values

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

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

valueOf

public static Days valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toNameShort

public java.lang.String toNameShort()

toName

public java.lang.String toName()

valueOf

public static Days valueOf(int day)
Returns the day of the give int value. 1 corresponds to Monday, 7 to Sunday

Parameters:
day - - int value representing the day
Returns:
- the day


Copyright © 2009 Sebastian Hennebrueder, http://www.laliluna.de