org.decisiondeck.jmcda.persist.xmcda2
Class XMCDAAlternativesMatrix

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.XMCDAAlternativesMatrix

public class XMCDAAlternativesMatrix
extends XMCDAHelperWithVarious

Methods for reading alternative matrixes from XMCDA fragments, and writing matrixes of alternatives to XMCDA.


Constructor Summary
XMCDAAlternativesMatrix()
          Creates a new object which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.
XMCDAAlternativesMatrix(XMCDAErrorsManager errorsManager)
          Creates a new object delegating error management to the given error manager in case of unexpected data read.
 
Method Summary
 Set<Alternative> getAlternatives()
          Retrieves a writeable view of the set of alternatives stored in this object.
 Set<Criterion> getCriteria()
          Retrieves a writeable view of the set of criteria stored in this object.
 IFloatMatrix<Alternative,Alternative> readAlternativesFloatMatrix(XAlternativesComparisons xAlternativesComparisons)
           Retrieves an alternative matrix corresponding to the given XMCDA information.
 IAltZeroToOneMatrix readAlternativesFuzzyMatrix(XAlternativesComparisons xAlternativesComparisons)
           TODO think about this strange thing with the matrix types.
 Map<Criterion,IAltZeroToOneMatrix> readAlternativesFuzzyMatrixesByCriteria(XAlternativesComparisons xAlternativesComparisons)
           Retrieves the alternative matrixes corresponding to the given XMCDA information, by criteria.
 void setAlternatives(Set<Alternative> alternatives)
          Sets the alternatives stored in this object as the given ones.
 void setCriteria(Set<Criterion> criteria)
          Sets the criteria stored in this object as the given ones.
 XAlternativesComparisons write(IRdFloatMatrix<Alternative,Alternative> matrix)
          Retrieves the XMCDA equivalent of the given matrix.
 XAlternativesComparisons write(Map<Criterion,? extends IRdFloatMatrix<Alternative,Alternative>> matrixes)
          Retrieves the XMCDA equivalent of the given matrix.
 
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

XMCDAAlternativesMatrix

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


XMCDAAlternativesMatrix

public XMCDAAlternativesMatrix(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

readAlternativesFuzzyMatrixesByCriteria

public Map<Criterion,IAltZeroToOneMatrix> readAlternativesFuzzyMatrixesByCriteria(XAlternativesComparisons xAlternativesComparisons)
                                                                           throws InvalidInputException

Retrieves the alternative matrixes corresponding to the given XMCDA information, by criteria.

The returned map has no empty matrixes as values if no unexpected data was read. If unexpected data was read an empty matrix may have been created.

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:
xAlternativesComparisons - not null.
Returns:
not null.
Throws:
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

write

public XAlternativesComparisons write(IRdFloatMatrix<Alternative,Alternative> matrix)
Retrieves the XMCDA equivalent of the given matrix. The matrix may be empty: this produces a valid tag anyway.

Parameters:
matrix - not null, may be incomplete.
Returns:
not null.

write

public XAlternativesComparisons write(Map<Criterion,? extends IRdFloatMatrix<Alternative,Alternative>> matrixes)
Retrieves the XMCDA equivalent of the given matrix.

Parameters:
matrixes - not null, no null key or values. The matrixes in values may be incomplete. It is not required that they contain homogeneous sets of rows or columns.
Returns:
not null.

readAlternativesFloatMatrix

public IFloatMatrix<Alternative,Alternative> readAlternativesFloatMatrix(XAlternativesComparisons xAlternativesComparisons)
                                                                  throws InvalidInputException

Retrieves an alternative matrix corresponding to the given XMCDA information.

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:
xAlternativesComparisons - not null.
Returns:
not null.
Throws:
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readAlternativesFuzzyMatrix

public IAltZeroToOneMatrix readAlternativesFuzzyMatrix(XAlternativesComparisons xAlternativesComparisons)
                                                throws InvalidInputException

TODO think about this strange thing with the matrix types.

Retrieves an alternative matrix corresponding to the given XMCDA information.

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:
xAlternativesComparisons - not null.
Returns:
not null.
Throws:
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

getAlternatives

public Set<Alternative> getAlternatives()
Retrieves a writeable view of the set of alternatives stored in this object.

Returns:
not null.

setAlternatives

public void setAlternatives(Set<Alternative> alternatives)
Sets the alternatives stored in this object as the given ones. No reference is held to the given set.

Parameters:
alternatives - not null, may be empty.

getCriteria

public Set<Criterion> getCriteria()
Retrieves a writeable view of the set of criteria stored in this object.

Returns:
not null.

setCriteria

public void setCriteria(Set<Criterion> criteria)
Sets the criteria stored in this object as the given ones. No reference is held to the given set.

Parameters:
criteria - not null, may be empty.


Copyright © 2011. All Rights Reserved.