|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectilog.rules.contrib.scorecard.xom.Scorecard
public class Scorecard
Scorecard is a representation of the scorecard object model.
| Constructor Summary | |
|---|---|
Scorecard()
|
|
| Method Summary | |
|---|---|
double |
formatNumber(double score,
int precision)
Rounds the score up or down to a specific precision level. |
java.util.List<IReason> |
getAllReasons()
Returns all the reasons fired when this scorecard runs. |
java.util.Map<java.lang.String,IScorecardAttribute> |
getAttributes()
Returns all the attributes contained in this scorecard. |
double |
getBaseScore()
Returns the base score for this scorecard. |
double |
getFinalScore()
Returns the final score. |
double |
getMaximumScore()
Returns the maximum score for this scorecard. |
int |
getMaxReasonNum()
Returns the maximum number of reasons to be returned. |
java.lang.String |
getName()
Returns the display name for this scorecard. |
java.util.Map<java.lang.String,IReason> |
getOriginalReasons()
Returns all reasons associated with this scorecard. |
java.util.List<IReason> |
getPotentialReasons()
Returns the reasons fired but not contained in the result when getReasons() is called. |
java.lang.String |
getReasonDuplicationBy()
Returns the reason duplication strategy. |
java.lang.String |
getReasonFilterBy()
Returns the reason filtering strategy. |
java.lang.String |
getReasonOrderBy()
Returns the reason ordering strategy. |
java.util.List<IReason> |
getReasons()
Returns the reasons generated when this scorecard runs. |
IRejection |
getRejection()
Returns the rejection instance associated with this scorecard. |
void |
print()
Prints the execution result in the console. |
void |
reset()
Resets this scorecard instance. |
void |
setAttributeExpectedScore(java.lang.String attrName,
double expectedScore)
Sets the expected score for a given attribute. |
void |
setAttributeMaxScore(java.lang.String attrName,
double maxScore)
Sets the maximum score for a given attribute. |
void |
setAttributeProperties(java.lang.String attrName,
double maxScore,
double expectedScore)
Sets the properties for a given attribute. |
void |
setAttributeProperties(java.lang.String attrName,
double weight,
double maxScore,
double expectedScore)
Sets all properties for a given attribute. |
void |
setBaseScore(double baseScore)
Sets the base score for this scorecard. |
void |
setComplexScorecard(ComplexScorecard complexScorecard)
Adds this Scorecard instance to a complex scorecard. |
void |
setConditionalMeans(java.lang.String attrName,
double conditionalMeans)
Set the conditional means for the given attribute. |
void |
setMaximumScore(double maximumScore)
Sets the maximum score for this scorecard. |
void |
setMaxReasonNum(int maxReasonNum)
Sets the maximum number of reasons to be returned. |
void |
setName(java.lang.String name)
Sets the name for this scorecard. |
void |
setReasonCode(java.lang.String attrName,
double numTypeValue,
java.lang.String reasonCode,
java.lang.String description,
int rank)
Sets the reason properties for a given attribute. |
void |
setReasonCode(java.lang.String attrName,
java.lang.String reasonCode,
java.lang.String description,
int rank)
of Sets the reason properties for a given attribute. |
void |
setReasonDuplicationBy(java.lang.String reasonDuplicationBy)
Sets the reason duplication strategy. |
void |
setReasonFilterBy(java.lang.String reasonFilterBy)
Sets the reason filtering strategy. |
void |
setReasoningStrategy(java.lang.String strategyName)
Sets the reasoning strategy. |
void |
setReasonOrderBy(java.lang.String reasonOrderBy)
Sets the reason ordering strategy. |
void |
setRejection(java.lang.String rejectCode,
java.lang.String description)
Sets the rejection code and the description associated with this scorecard. |
void |
setScore(java.lang.String attrName,
double score)
Sets the score for a given attribute. |
void |
setScore(java.lang.String attrName,
double score,
double weight)
Sets the score and weight for a given attribute. |
void |
setScoringStrategy(java.lang.String strategyName)
Sets the scoring strategy. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Scorecard()
| Method Detail |
|---|
public double formatNumber(double score,
int precision)
score - The original score.precision - The precision level.
public java.util.Map<java.lang.String,IScorecardAttribute> getAttributes()
public double getBaseScore()
public double getFinalScore()
getRejection() before returning the score using this method.
The following code example shows how to validate the scorecard:
IRejection rejection = scorecardInst.getRejection();
if (null == rejection)
return scorecardInst.getFinalScore();
else
throw new Exception("The scorecard " + scorecardInst.getName() + "is rejected because of " + rejection.getDescription());
public double getMaximumScore()
public int getMaxReasonNum()
public java.lang.String getName()
public java.util.Map<java.lang.String,IReason> getOriginalReasons()
public java.util.List<IReason> getPotentialReasons()
getReasons() is called.
getReasons()public java.lang.String getReasonDuplicationBy()
public java.lang.String getReasonFilterBy()
public java.lang.String getReasonOrderBy()
public java.util.List<IReason> getReasons()
public java.util.List<IReason> getAllReasons()
public IRejection getRejection()
null, the scorecard MUST
be rejected. getFinalScore() to
test if a score is valid.
getFinalScore()public void print()
public void reset()
public void setAttributeMaxScore(java.lang.String attrName,
double maxScore)
attrName - The attribute name.maxScore - The maximum score for attrName.public void setAttributeExpectedScore(java.lang.String attrName,
double expectedScore)
attrName - The attribute name.expectedScore - The expected score for attrName.public void setAttributeProperties(java.lang.String attrName,
double maxScore,
double expectedScore)
attrName - The attribute name.maxScore - The maximum score for attrName.expectedScore - The expected score for attrName.public void setAttributeProperties(java.lang.String attrName,
double weight,
double maxScore,
double expectedScore)
attrName - The attribute name.weight - The weight for attrName.maxScore - The maximum score for attrName.expectedScore - The expected score for attrName.public void setBaseScore(double baseScore)
baseScore - The new base score.public void setComplexScorecard(ComplexScorecard complexScorecard)
Scorecard instance to a complex scorecard.
complexScorecard - The complex scorecard to add this Scorecard
instance to.public void setConditionalMeans(java.lang.String attrName,
double conditionalMeans)
attrName - The attribute name.conditionalMeans - The conditional means for attrName.public void setMaximumScore(double maximumScore)
maximumScore - The new maximum score.public void setMaxReasonNum(int maxReasonNum)
maxReasonNum - The maximum number of reasons to be returned.public void setName(java.lang.String name)
name - The new scorecard name.public void setReasonCode(java.lang.String attrName,
double numTypeValue,
java.lang.String reasonCode,
java.lang.String description,
int rank)
attrName - The attribute name.numTypeValue - The attribute value for attrName.reasonCode - The reason code for attrName.description - The description for attrName.rank - The rank for attrName.public void setReasonCode(java.lang.String attrName,
java.lang.String reasonCode,
java.lang.String description,
int rank)
attrName - The attribute name.reasonCode - The reason code for attrName.description - The description for attrName.rank - The rank for attrName.public void setReasonDuplicationBy(java.lang.String reasonDuplicationBy)
reasonDuplicationBy - The new reason duplication strategy.public void setReasonFilterBy(java.lang.String reasonFilterBy)
reasonFilterBy - The new reason filtering strategy.public void setReasoningStrategy(java.lang.String strategyName)
strategyName - The new strategy namepublic void setReasonOrderBy(java.lang.String reasonOrderBy)
reasonOrderBy - The reason ordering strategy.public void setRejection(java.lang.String rejectCode,
java.lang.String description)
rejectCode - The new rejection code.description - The new description.public void setScore(java.lang.String attrName,
double score)
attrName - The attribute name.score - The score associated with this attribute.public void setScore(java.lang.String attrName,
double score,
double weight)
attrName - The attribute name.score - The score for attrName.weight - The weight for attrName.public void setScoringStrategy(java.lang.String strategyName)
strategyName - The new strategy name.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||