public class FailureType
extends java.lang.Object
Constructor and Description |
---|
FailureType(java.lang.String failureTitle)
Creates a failure with only the description.
|
FailureType(java.lang.String failureTitle,
java.lang.String penalty)
Creates a failure with only the description.
|
FailureType(java.lang.String title,
java.lang.String maxPenalty,
java.lang.String eachPenalty)
Allows us to create a failure with a maximum and a first penalty.
|
FailureType(java.lang.String title,
java.lang.String maxPenalty,
java.lang.String firstPenalty,
java.lang.String eachPenalty)
Allows us to create a failure with a description, a maximum penalty, a
first penalty and the rest of the penalties applied
|
Modifier and Type | Method and Description |
---|---|
double |
calculatePenalty(PenaltyHelper penaltyHelper,
int numberOfFailures) |
boolean |
equals(java.lang.Object other) |
java.lang.String |
getEachPenalty() |
java.lang.String |
getFirstPenalty() |
java.lang.String |
getMaxPenalty() |
java.lang.String |
getTitle() |
int |
hashCode() |
public FailureType(java.lang.String failureTitle)
failureTitle
- Title of the failure. Identificator of the FailureTypepublic FailureType(java.lang.String failureTitle, java.lang.String penalty)
failureTitle
- Title of the failure. Identificator of the FailureTypepenalty
- Penalty used for this type of failurepublic FailureType(java.lang.String title, java.lang.String maxPenalty, java.lang.String eachPenalty)
title
- Title of the failure. Identificator of the FailureTypemaxPenalty
- Maximum penalty allowed for this type of failureeachPenalty
- Each penalty applied to the grade for this type of failurepublic FailureType(java.lang.String title, java.lang.String maxPenalty, java.lang.String firstPenalty, java.lang.String eachPenalty)
title
- Title of the failure. Identificator of the FailureTypemaxPenalty
- Maximum penalty allowed for this type of failurefirstPenalty
- First penalty applied to the grade for this type of failureeachPenalty
- Each penalty applied to the grade for this type of failurepublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getTitle()
public java.lang.String getMaxPenalty()
public java.lang.String getFirstPenalty()
public java.lang.String getEachPenalty()
public double calculatePenalty(PenaltyHelper penaltyHelper, int numberOfFailures)