Package de.hsh.graja.core.result
Class AbstractResultNode
- java.lang.Object
-
- de.hsh.graja.core.result.AbstractResultNode
-
- All Implemented Interfaces:
ContentLogger
- Direct Known Subclasses:
AbstractGradingAspectResult
,FailableAbstractResultNode
public abstract class AbstractResultNode extends Object implements ContentLogger
A result node in the Graja core. Results have the following data:- An achieved score
- A boolean success value
- Comments consisting of
- A plain text headline
- A header comment
- A leading comment
- one or more subresults
- A trailing comment
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractResultNode()
protected
AbstractResultNode(String headline, Anchor anchor, Content header, Sequence description, Sequence leading, Sequence trailing)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addItem(Content item)
This method implementsCommentLogger
and simply delegates to addLeadingCommentItem.void
addLeadingCommentItem(Content item)
void
addTrailingCommentItem(Content item)
abstract double
calcRawScoreAchieved()
Returns the unweighted and non nullified achieved score.abstract double
calcScoreAchievedAfterWeighting()
Returns the weighted score, that has not yet been nullified.abstract double
calcScoreAchievedAfterWeightingAndNullification()
Returns the achieved score.abstract Collection<Grade>
collectGrades()
Anchor
getAnchor()
Sequence
getDescriptionComment()
Content
getHeaderComment()
String
getHeadline()
Content
getLeadingComment()
Content
getTrailingComment()
void
setAnchor(Anchor anchor)
void
setHeaderComment(Content header)
void
setHeadline(String headline)
-
-
-
Method Detail
-
collectGrades
public abstract Collection<Grade> collectGrades()
-
calcRawScoreAchieved
public abstract double calcRawScoreAchieved()
Returns the unweighted and non nullified achieved score. The achieved score is calculated in three steps:
- First the mere score without any postprocessing is calculated. We call this the "raw achieved score".
- Second, the score gets multiplied by a weight. We call the resulting score the "achieved score after weighting"
- Last, the score is processed by nullification conditions. We call the resulting score the "achieved score after weighting and nullification".
- Returns:
- the raw achieved score.
-
calcScoreAchievedAfterWeighting
public abstract double calcScoreAchievedAfterWeighting()
Returns the weighted score, that has not yet been nullified. The achieved score is calculated in three steps:
- First the mere score without any postprocessing is calculated. We call this the "raw achieved score".
- Second, the score gets multiplied by a weight. We call the resulting score the "achieved score after weighting"
- Last, the score is processed by nullification conditions. We call the resulting score the "achieved score after weighting and nullification".
- Returns:
- the weigthed achieved score. Nullifications are not included.
-
calcScoreAchievedAfterWeightingAndNullification
public abstract double calcScoreAchievedAfterWeightingAndNullification()
Returns the achieved score. The achieved score is calculated in three steps:
- First the mere score without any postprocessing is calculated. We call this the "raw achieved score".
- Second, the score gets multiplied by a weight. We call the resulting score the "achieved score after weighting"
- Last, the score is processed by nullification conditions. We call the resulting score the "achieved score after weighting and nullification".
- Returns:
- the achieved score. The weight and nullifications are included already.
-
addItem
public void addItem(Content item)
This method implementsCommentLogger
and simply delegates to addLeadingCommentItem.- Specified by:
addItem
in interfaceContentLogger
-
setHeadline
public void setHeadline(String headline)
-
setAnchor
public void setAnchor(Anchor anchor)
-
setHeaderComment
public void setHeaderComment(Content header)
-
addLeadingCommentItem
public void addLeadingCommentItem(Content item)
-
addTrailingCommentItem
public void addTrailingCommentItem(Content item)
-
getHeadline
public String getHeadline()
-
getAnchor
public Anchor getAnchor()
-
getHeaderComment
public Content getHeaderComment()
-
getDescriptionComment
public Sequence getDescriptionComment()
-
getLeadingComment
public Content getLeadingComment()
-
getTrailingComment
public Content getTrailingComment()
-
-