Record Class Answer.Score

java.lang.Object
java.lang.Record
xyz.tcheeric.jev.Answer.Score
Record Components:
legend - each level index mapped back to the description the evaluator was given, lowest level first
distribution - each level index mapped to its probability, lowest level first
All Implemented Interfaces:
Answer
Enclosing interface:
Answer

public static record Answer.Score(String name, double score, Map<Integer,String> legend, Map<Integer,Double> distribution, double confidence) extends Record implements Answer
A rating against the question's ordered levels. Levels are identified by their index in the question's level list, starting at 0.

score is the probability-weighted mean of those indices, so it is fractional and can land between two levels: 1.05 on a three-level rubric means "almost exactly the middle level, leaning slightly up". It is on the scale 0 to legend.size() - 1, not 0 to 1; a consumer that wants a unit interval divides by that itself, since whether a linear rescale is meaningful depends on how evenly it spaced its own levels.

  • Constructor Details

    • Score

      public Score(String name, double score, Map<Integer,String> legend, Map<Integer,Double> distribution, double confidence)
      Creates an instance of a Score record class.
      Parameters:
      name - the value for the name record component
      score - the value for the score record component
      legend - the value for the legend record component
      distribution - the value for the distribution record component
      confidence - the value for the confidence record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface Answer
      Returns:
      the value of the name record component
    • score

      public double score()
      Returns the value of the score record component.
      Returns:
      the value of the score record component
    • legend

      public Map<Integer,String> legend()
      Returns the value of the legend record component.
      Returns:
      the value of the legend record component
    • distribution

      public Map<Integer,Double> distribution()
      Returns the value of the distribution record component.
      Returns:
      the value of the distribution record component
    • confidence

      public double confidence()
      Returns the value of the confidence record component.
      Returns:
      the value of the confidence record component