org.decisiondeck.jmcda.persist.xmcda2
Class XMCDAEvaluations

java.lang.Object
  extended by org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelper
      extended by org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelperWithVarious
          extended by org.decisiondeck.jmcda.persist.xmcda2.XMCDAEvaluations

public class XMCDAEvaluations
extends XMCDAHelperWithVarious

Methods for reading and writing evaluations informations (called performance tables in XMCDA terms) from and to XMCDA fragments.


Constructor Summary
XMCDAEvaluations()
          Creates a new object which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.
XMCDAEvaluations(XMCDAErrorsManager errorsManager)
          Creates a new object delegating error management to the given error manager in case of unexpected data read.
 
Method Summary
 boolean hasNames(Collection<XPerformanceTable> xPerformanceTables)
           Tests whether the given XMCDA fragment possibly contains evaluations informations per decision maker.
 EvaluationMatrix read(Collection<XPerformanceTable> xPerformanceTables)
           Retrieves all the evaluations contained into the given XMCDA fragments.
 EvaluationMatrix read(XPerformanceTable xPerformanceTable)
           Retrieves the evaluations contained into the given XMCDA fragment.
 Map<DecisionMaker,EvaluationMatrix> readPerDecisionMaker(Collection<XPerformanceTable> xPerformanceTables)
           Retrieves the evaluations, per decision maker, contained into the given XMCDA fragments.
 void setAlternativesOrder(Collection<Alternative> alternativesOrder)
           
 void setCriteriaOrder(Collection<Criterion> criteriaOrder)
           
 void setDmsOrder(Collection<DecisionMaker> dmsOrder)
           
 XPerformanceTable write(IRdEvaluations evaluations)
          Retrieves the given evaluations informations as an XMCDA fragment.
 Collection<XPerformanceTable> write(Map<DecisionMaker,IRdEvaluations> allEvaluations)
          Retrieves the given evaluations informations as a collection of XMCDA fragment, per decision maker.
 
Methods inherited from class org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelper
error, getStrategy, setStrategy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMCDAEvaluations

public XMCDAEvaluations()
Creates a new object which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.


XMCDAEvaluations

public XMCDAEvaluations(XMCDAErrorsManager errorsManager)
Creates a new object delegating error management to the given error manager in case of unexpected data read.

Parameters:
errorsManager - not null.
Method Detail

read

public EvaluationMatrix read(XPerformanceTable xPerformanceTable)
                      throws InvalidInputException

Retrieves the evaluations contained into the given XMCDA fragment.

In case of unexpected data, an exception is thrown if this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy, otherwise, non conforming informations will be skipped.

Parameters:
xPerformanceTable - not null.
Returns:
not null.
Throws:
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readPerDecisionMaker

public Map<DecisionMaker,EvaluationMatrix> readPerDecisionMaker(Collection<XPerformanceTable> xPerformanceTables)
                                                         throws InvalidInputException

Retrieves the evaluations, per decision maker, contained into the given XMCDA fragments. Iteration order of the returned map matches that of the given collection.

In case of unexpected data, an exception is thrown if this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy, otherwise, non conforming informations will be skipped.

Parameters:
xPerformanceTables - not null.
Returns:
not null.
Throws:
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

write

public XPerformanceTable write(IRdEvaluations evaluations)
Retrieves the given evaluations informations as an XMCDA fragment.

Parameters:
evaluations - not null, not empty.
Returns:
not null.

setDmsOrder

public void setDmsOrder(Collection<DecisionMaker> dmsOrder)

setCriteriaOrder

public void setCriteriaOrder(Collection<Criterion> criteriaOrder)

setAlternativesOrder

public void setAlternativesOrder(Collection<Alternative> alternativesOrder)

write

public Collection<XPerformanceTable> write(Map<DecisionMaker,IRdEvaluations> allEvaluations)
Retrieves the given evaluations informations as a collection of XMCDA fragment, per decision maker.

Parameters:
allEvaluations - not null, no null entries, no empty entries.
Returns:
not null.

read

public EvaluationMatrix read(Collection<XPerformanceTable> xPerformanceTables)
                      throws InvalidInputException

Retrieves all the evaluations contained into the given XMCDA fragments.

In case of unexpected data, an exception is thrown if this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy, otherwise, non conforming informations will be skipped.

Parameters:
xPerformanceTables - not null.
Returns:
not null.
Throws:
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

hasNames

public boolean hasNames(Collection<XPerformanceTable> xPerformanceTables)

Tests whether the given XMCDA fragment possibly contains evaluations informations per decision maker.

Parameters:
xPerformanceTables - not null.
Returns:
true iff the given collection is not empty and its elements each have their name set.


Copyright © 2011. All Rights Reserved.