org.decisiondeck.xmcda_oo.structure
Class AlternativeEvaluations

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.structure.AlternativeEvaluations

public class AlternativeEvaluations
extends Object


Constructor Summary
AlternativeEvaluations()
           
AlternativeEvaluations(Map<Criterion,Double> evaluations)
          Iteration order of the given evaluations is kept: this is used in the toString() method, for debug.
 
Method Summary
 boolean dominates(AlternativeEvaluations target)
           
 boolean equals(Object obj)
           
 Double getEvaluation(Criterion criterion)
           
 Map<Criterion,Double> getEvaluations()
           
 int hashCode()
           
 Double putEvaluation(Criterion criterion, Double evaluation)
           
 void setOrder(Set<Criterion> critsOrder)
          Sets the order on which the criteria are enumerated when using the toString() method.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlternativeEvaluations

public AlternativeEvaluations()

AlternativeEvaluations

public AlternativeEvaluations(Map<Criterion,Double> evaluations)
Iteration order of the given evaluations is kept: this is used in the toString() method, for debug.

Parameters:
evaluations - not null.
Method Detail

getEvaluations

public Map<Criterion,Double> getEvaluations()
Returns:
the evaluations contained in this object. Not null. Can also be used to modify this object's evaluations.

getEvaluation

public Double getEvaluation(Criterion criterion)
Parameters:
criterion - not null.
Returns:
null iff no evaluation is defined for that criterion (i.e. that criterion is not contained in this object).

putEvaluation

public Double putEvaluation(Criterion criterion,
                            Double evaluation)
Parameters:
criterion - not null.
evaluation - null to remove the evaluation associated to the given criterion.
Returns:
the previous evaluation associated to this criterion, or null if there was none.

setOrder

public void setOrder(Set<Criterion> critsOrder)
Sets the order on which the criteria are enumerated when using the toString() method. If other criteria are added afterwards to this object, the order is not defined.

Parameters:
critsOrder - will be iterated over, thus should be ordered (a SortedSet or a LinkedHashSet may be used, e.g.). Must contain exactly the same set of criteria this object contains evaluations for.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

dominates

public boolean dominates(AlternativeEvaluations target)
                  throws InvalidInputException
Parameters:
target - must be evaluated on the same criteria set than this object.
Returns:
true iff this object strictly dominates the given one.
Throws:
InvalidInputException - iff a preference direction is unknown.


Copyright © 2011. All Rights Reserved.