Package MySTARS

Enum AU

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

public enum AU
extends java.lang.Enum<AU>
An enum that keeps track of the numebr of Academic Units that each Course is worth.
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
    FOUR
    An enum representing 4 Academic Units.
    ONE
    An enum representing 1 Academic Unit.
    THREE
    An enum representing 3 Academic Units.
    TWO
    An enum representing 2 Academic Units.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.Integer value
    An Integer value that is associated with each Enum value.
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    private AU​(java.lang.Integer value)
    Initialiser for the Enum that ensures each Enum value has a corresponding Integer value.
  • Method Summary

    Modifier and Type Method Description
    static AU getAU​(int acadUnit)
    A helper method that converts an input integer value to the appropriate AU value.
    static AU valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static AU[] 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

    • ONE

      public static final AU ONE
      An enum representing 1 Academic Unit.
    • TWO

      public static final AU TWO
      An enum representing 2 Academic Units.
    • THREE

      public static final AU THREE
      An enum representing 3 Academic Units.
    • FOUR

      public static final AU FOUR
      An enum representing 4 Academic Units.
  • Field Details

    • value

      public final java.lang.Integer value
      An Integer value that is associated with each Enum value.
  • Constructor Details

    • AU

      private AU​(java.lang.Integer value)
      Initialiser for the Enum that ensures each Enum value has a corresponding Integer value.
      Parameters:
      value - The Integer value of the Enum.
  • Method Details

    • values

      public static AU[] 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 AU 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
    • getAU

      public static AU getAU​(int acadUnit)
      A helper method that converts an input integer value to the appropriate AU value.
      Parameters:
      acadUnit - The integer value to compare with.
      Returns:
      The relevant AU value for a given integer. Defaults to AU.ONE if no match found.