|
Predictions 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object hirondelle.predict.main.prediction.Prediction
public final class Prediction
Model Object for a Prediction.
This class is interesting since it does not include the foreign key to the PredictionList table; that is taken only from the session, not from the database, nor from user input.
This object is immutable, and makes defensive copies where needed.
Constructor Summary | |
---|---|
Prediction(Id aId,
Id aParentId,
SafeText aText,
DateTime aCreationDate,
SafeText aRemark,
Id aOutcome,
DateTime aOutcomeDate)
Full constructor. |
|
Prediction(Id aId,
Id aParentId,
SafeText aText,
SafeText aRemark,
Id aOutcome)
Partial constructor, used for user input. |
Method Summary | |
---|---|
static Integer |
calculateAverageScore(List<Prediction> aPredictions)
Calculate the average of getOutcomeScore() for all of the predictions in a list. |
boolean |
equals(Object aThat)
|
DateTime |
getCreationDate()
|
Id |
getId()
|
Code |
getOutcome()
|
DateTime |
getOutcomeDate()
|
Integer |
getOutcomeScore()
Returns null if there is no outcome. |
Id |
getParentId()
|
SafeText |
getRemark()
|
SafeText |
getText()
|
int |
hashCode()
|
String |
toString()
|
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Prediction(Id aId, Id aParentId, SafeText aText, DateTime aCreationDate, SafeText aRemark, Id aOutcome, DateTime aOutcomeDate) throws ModelCtorException
aId
- internal database identifier (optional)aParentId
- internal database identifier (required)aText
- main text of the prediction max 255 characters (required)aCreationDate
- date-time the prediction was created (required)aRemark
- any remark the user may wish to make (justification, special remark on the outcome, etc.) max 2000 chars (optional)aOutcome
- final outcome of the prediction (optional)aOutcomeDate
- Date the final outcome was established, if ever (optional); if outcome is specified, then the
outcome date must also be specified
ModelCtorException
public Prediction(Id aId, Id aParentId, SafeText aText, SafeText aRemark, Id aOutcome) throws ModelCtorException
Similar to the full constructor, but the user never inputs the creation date, or the outcome date. Here, those dates are simply set to null.
ModelCtorException
Method Detail |
---|
public Id getId()
public Id getParentId()
public SafeText getText()
public DateTime getCreationDate()
public SafeText getRemark()
public Code getOutcome()
public Integer getOutcomeScore()
CodeTable.OUTCOMES
).
public DateTime getOutcomeDate()
public static Integer calculateAverageScore(List<Prediction> aPredictions)
getOutcomeScore()
for all of the predictions in a list.
Predictions which have a null outcome do not contribute to the result. If none of the predictions in the list have an outcome, then null is returned. Integer division is used to calculate the result, so there will be some rounding.
public String toString()
toString
in class Object
public boolean equals(Object aThat)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
Predictions 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |