Class TeachingUnitResult

java.lang.Object
TeachingUnitResult

public class TeachingUnitResult extends Object
A result corresponding to a grade associated with a teaching unit.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TeachingUnitResult(String teachingUnitName, Grade grade)
    Constructs an instance of TeachingUnitResult with a grade equals to the specified grade and a teaching unit name equals to the specified teachingUnitName.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines whether or not two results are equal.
    Returns the grade associated to the result.
    int
    Returns a hash code value for the object.
    Returns a string representation of the result in the format Name of the teaching unit : X.X.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TeachingUnitResult

      public TeachingUnitResult(String teachingUnitName, Grade grade)
      Constructs an instance of TeachingUnitResult with a grade equals to the specified grade and a teaching unit name equals to the specified teachingUnitName.
      Parameters:
      teachingUnitName - the name of the teaching unit of the constructed TeachingUnitResult
      grade - the grade of the constructed TeachingUnitResult
  • Method Details

    • getGrade

      public Grade getGrade()
      Returns the grade associated to the result.
      Returns:
      the grade associated to the result
    • toString

      public String toString()
      Returns a string representation of the result in the format Name of the teaching unit : X.X.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the result
    • equals

      public boolean equals(Object o)
      Determines whether or not two results are equal. Two instances of TeachingUnitResult are equal if the values of their teachingUnitName and grade member fields are the same.
      Overrides:
      equals in class Object
      Parameters:
      o - an object to be compared with this TeachingUnitResult
      Returns:
      true if the object to be compared is an instance of TeachingUnitResult and has the same grad and teaching unit name; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.