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
-
Enum Constant Summary
-
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.
-
Enum Constant Details
-
Field Details
-
value
public final java.lang.Integer valueAn 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
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
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 namejava.lang.NullPointerException
- if the argument is null
-
getAU
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.
-