Package xyz.tcheeric.jev
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 firstdistribution- 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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface xyz.tcheeric.jev.Answer
Answer.Choice, Answer.Noul, Answer.Score -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theconfidencerecord component.Returns the value of thedistributionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.legend()Returns the value of thelegendrecord component.name()Returns the value of thenamerecord component.doublescore()Returns the value of thescorerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Score
public Score(String name, double score, Map<Integer, String> legend, Map<Integer, Double> distribution, double confidence) Creates an instance of aScorerecord class.- Parameters:
name- the value for thenamerecord componentscore- the value for thescorerecord componentlegend- the value for thelegendrecord componentdistribution- the value for thedistributionrecord componentconfidence- the value for theconfidencerecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component. -
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
legend
Returns the value of thelegendrecord component.- Returns:
- the value of the
legendrecord component
-
distribution
Returns the value of thedistributionrecord component.- Returns:
- the value of the
distributionrecord component
-
confidence
public double confidence()Returns the value of theconfidencerecord component.- Returns:
- the value of the
confidencerecord component
-