|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.tum.cs.commons.assessment.Assessment
public class Assessment
This class stores an assessment. An assessment is a multiset of traffic light colors (i.e. a mapping from traffic light colors to non-negative integers).
Constructor Summary | |
---|---|
Assessment()
Creates an empty assessment (i.e. one with all entries set to 0). |
|
Assessment(ETrafficLightColor color)
Create an assessment with a single color entry. |
|
Assessment(ETrafficLightColor color,
java.lang.String message)
Create an assessement with a assessment message. |
Method Summary | |
---|---|
void |
add(Assessment a)
Merge the provided assessment into this, i.e. increase all trafic light color counts by the values in the provided asseessment. |
void |
add(ETrafficLightColor color)
Add a single entry of this color to this assessment. |
void |
add(ETrafficLightColor color,
int count)
Add a single entry of this color to this assessment. |
static Assessment |
aggregate(java.util.Collection<Assessment> values)
Aggregate assessments. |
protected java.lang.Object |
clone()
|
Assessment |
deepClone()
Deep clone of this object. |
boolean |
equals(java.lang.Object obj)
|
int |
getColorFrequency(ETrafficLightColor color)
|
ETrafficLightColor |
getDominantColor()
|
java.lang.String |
getMessage()
Get assessment message. |
ETrafficLightColor |
getMostFrequentColor()
|
int |
hashCode()
|
void |
setMessage(java.lang.String message)
Set assessment message. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Assessment()
public Assessment(ETrafficLightColor color)
color
- the color included in this assessment.public Assessment(ETrafficLightColor color, java.lang.String message)
Method Detail |
---|
public void add(ETrafficLightColor color)
color
- the color added to this assessment.public void add(ETrafficLightColor color, int count)
color
- the color added to this assessment.count
- how often to add this color to the assessment.public void add(Assessment a)
a
- the assessment to merge in.public int getColorFrequency(ETrafficLightColor color)
color
- the color whose frequency to read.
public ETrafficLightColor getDominantColor()
ETrafficLightColor
are ordered according to their
dominance.public ETrafficLightColor getMostFrequentColor()
getDominantColor()
) one is returned.public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public Assessment deepClone()
deepClone
in interface IDeepCloneable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getMessage()
null
if this assessment has no
message.public void setMessage(java.lang.String message)
message
- the message or null
if this assessment has no
message.public static Assessment aggregate(java.util.Collection<Assessment> values)
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |