Package MySTARS

Enum DayOfWeek

java.lang.Object
java.lang.Enum<DayOfWeek>
MySTARS.DayOfWeek
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DayOfWeek>, java.lang.constant.Constable

public enum DayOfWeek
extends java.lang.Enum<DayOfWeek>
An Enum that keeps track of the day of the week to simplify time tracking.
Since:
2020-11-1
Version:
1.0
Author:
Bhargav
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum Constant Description
    FRIDAY
    Enum value representing Friday.
    MONDAY
    Enum value representing Monday.
    SATURDAY
    Enum value representing Saturday.
    SUNDAY
    Enum value representing Sunday.
    THURSDAY
    Enum value representing Thursday.
    TUESDAY
    Enum value representing Tuesday.
    WEDNESDAY
    Enum value representing Wednesday.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String label
    The String value of the day of the week to 3 Characters.
    java.lang.Integer value
    The Integer value corresponding to the DayOfWeek in DateTime.
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    private DayOfWeek​(java.lang.Integer value, java.lang.String label)
    Initialiser for Enum DayOfWeek to ensure that all values have a label and a value.
  • Method Summary

    Modifier and Type Method Description
    static DayOfWeek getDayOfWeek​(int day)
    Helper function that returns the corresponding DayOfWeek value for a given day in integer format.
    static DayOfWeek valueOf​(java.lang.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, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • MONDAY

      public static final DayOfWeek MONDAY
      Enum value representing Monday.
    • TUESDAY

      public static final DayOfWeek TUESDAY
      Enum value representing Tuesday.
    • WEDNESDAY

      public static final DayOfWeek WEDNESDAY
      Enum value representing Wednesday.
    • THURSDAY

      public static final DayOfWeek THURSDAY
      Enum value representing Thursday.
    • FRIDAY

      public static final DayOfWeek FRIDAY
      Enum value representing Friday.
    • SATURDAY

      public static final DayOfWeek SATURDAY
      Enum value representing Saturday.
    • SUNDAY

      public static final DayOfWeek SUNDAY
      Enum value representing Sunday.
  • Field Details

    • value

      public final java.lang.Integer value
      The Integer value corresponding to the DayOfWeek in DateTime.
    • label

      public final java.lang.String label
      The String value of the day of the week to 3 Characters.
  • Constructor Details

    • DayOfWeek

      private DayOfWeek​(java.lang.Integer value, java.lang.String label)
      Initialiser for Enum DayOfWeek to ensure that all values have a label and a value.
      Parameters:
      value - Integer value representing a day of the week, starting with 1 for Monday.
      label - A String value corresponding to a day of the week, to 3 Characters.
  • Method Details

    • values

      public static DayOfWeek[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

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

      public static DayOfWeek getDayOfWeek​(int day)
      Helper function that returns the corresponding DayOfWeek value for a given day in integer format.
      Parameters:
      day - The day of the week in integer form.
      Returns:
      The DayOfWeek, defaults to Monday if int day is out of range.