org.decisiondeck.jmcda.persist.xmcda2.aggregates
Class XMCDASortingProblemReader

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.aggregates.XMCDASortingProblemReader

public class XMCDASortingProblemReader
extends XMCDAHelperWithVarious

A class to read MCDA sorting problems defined in XMCDA documents, including the typical preferences informations related to a sorting problem, namely thresholds and coalitions; and sorting results, namely assignments. Support is given for assignments to single categories, assignments to multiple categories and assignments with credibilites. This class supports the case of a single decision maker.

See Also:
org.decisiondeck.jmcda.persist.xmcda2

Constructor Summary
XMCDASortingProblemReader()
          Creates a new reader which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.
XMCDASortingProblemReader(InputSupplier<? extends InputStream> mainSource)
          Creates a new reader with a main source.
XMCDASortingProblemReader(InputSupplier<? extends InputStream> mainSource, XMCDAErrorsManager errorsManager)
          Creates a new reader with a main source, and delegating error management to the given error manager in case of unexpected data read.
XMCDASortingProblemReader(URL mainSource)
          Creates a new reader with a main source.
XMCDASortingProblemReader(XMCDAErrorsManager errorsManager)
          Creates a new reader delegating error management to the given error manager in case of unexpected data read.
 
Method Summary
 void clearCache()
          Clears the information cached in this class, resulting in the loss of any previously read information that had been remembered by this class.
 boolean equal(InputSupplier<? extends InputStream> source1, InputSupplier<? extends InputStream> source2)
          Tests whether two sources are equal when replacing a null source with the main source.
 XMCDAAlternatives.AlternativesParsingMethod getAlternativesParsingMethod()
          Retrieves the parsing method used to read alternatives.
 InputSupplier<? extends InputStream> getSourceAlternatives()
          Retrieves the source dedicated to alternatives.
 InputSupplier<? extends InputStream> getSourceAlternativesEvaluations()
          Retrieves the source dedicated to alternatives evaluations.
 InputSupplier<? extends InputStream> getSourceAssignments()
          Retrieves the source dedicated to assignments.
 InputSupplier<? extends InputStream> getSourceCategories()
          Retrieves the source dedicated to categories.
 InputSupplier<? extends InputStream> getSourceCategoriesProfiles()
          Retrieves the source dedicated to definition of the categories through bounding profiles.
 InputSupplier<? extends InputStream> getSourceCoalitions()
          Retrieves the source dedicated to coalitions.
 InputSupplier<? extends InputStream> getSourceCriteria()
          Retrieves the source dedicated to criteria.
 InputSupplier<? extends InputStream> getSourceMain()
          Retrieves the main source.
 InputSupplier<? extends InputStream> getSourceProfiles()
          Retrieves the source dedicated to profiles.
 InputSupplier<? extends InputStream> getSourceProfilesEvaluations()
          Retrieves the source dedicated to profiles evaluations.
 String getSourceVersion()
          Retrieves the XMCDA version of the documents read by this object.
 XMCDADoc.XMCDA getXMCDA(InputSupplier<? extends InputStream> source)
          Retrieves the XMCDA document from the given source or from the main source if the given source is null.
 Set<Alternative> readAlternatives()
           Reads the alternatives from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 IRdEvaluations readAlternativesEvaluations()
           Reads the evaluations from the alternatives evaluations source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 IAssignmentsRead readAssignments()
           Reads the assignments from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully, as a set of assignments of an alternative to a single category.
 IAssignmentsToMultipleRead readAssignmentsToMultiple()
           Reads the assignments from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully, as a set of assignments of an alternative to multiple categories.
 IAssignmentsWithCredibilitiesRead readAssignmentsWithCredibilities()
           Reads the assignments from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully, as a set of assignments of an alternative to multiple categories with associated credibilities.
 NavigableSet<Category> readCategories()
           Reads the categories from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 ICatsAndProfs readCategoriesProfiles()
           Reads the categories, together with their relations with the profiles defining them, from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 ICoalitions readCoalitions()
           Reads the coalitions from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 Set<Criterion> readCriteria()
           Reads the criteria from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 IRdEvaluations readEvaluations()
           Retrieves the union of the evaluations read from the alternatives evaluations source and the evaluations read from the profiles evaluations source, or from the the main source if the dedicated source is not set.
 Set<Alternative> readProfiles()
           Reads the profiles from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 IRdEvaluations readProfilesEvaluations()
           Reads the profiles from the profiles evaluations source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 Map<Criterion,IOrderedInterval> readScales()
           Reads the scales from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 ISortingData readSortingData()
           Retrieves an aggregator object that gather several object type.
 ISortingPreferences readSortingPreferences()
           Retrieves an aggregator object that gather several object type.
 ISortingResults readSortingResults()
           Retrieves an aggregator object that gather several object type.
 ISortingResultsToMultiple readSortingResultsToMultiple()
           Retrieves an aggregator object that gather several object type.
 ISortingResultsWithCredibilities readSortingResultsWithCredibilities()
           Retrieves an aggregator object that gather several object type.
 ICriteriaWithThresholds readThresholds()
           Reads the thresholds from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.
 void setAlternativesParsingMethod(XMCDAAlternatives.AlternativesParsingMethod alternativesParsingMethod)
          Sets the parsing method used to read alternatives and profiles.
 void setSourceAlternatives(InputSupplier<? extends InputStream> sourceAlternatives)
          Sets the dedicated source used to read alternatives.
 void setSourceAlternativesEvaluations(InputSupplier<? extends InputStream> sourceAlternativesEvaluations)
          Sets the dedicated source used to read the evaluations of the alternatives.
 void setSourceAssignments(InputSupplier<? extends InputStream> source)
          Sets the dedicated source used to read assignments.
 void setSourceCategories(InputSupplier<? extends InputStream> source)
          Sets the dedicated source used to read the categories.
 void setSourceCategoriesProfiles(InputSupplier<? extends InputStream> sourceCategoriesProfiles)
          Sets the dedicated source used to read the categories and associated profiles.
 void setSourceCoalitions(InputSupplier<? extends InputStream> sourceCoalitions)
          Sets the dedicated source used to read the coalitions.
 void setSourceCriteria(InputSupplier<? extends InputStream> sourceCriteria)
          Sets the dedicated source used to read the criteria.
 void setSourceMain(InputSupplier<? extends InputStream> sourceMain)
          Sets the main source used to read all types of objects for which no dedicated source is set.
 void setSourceProfiles(InputSupplier<? extends InputStream> sourceProfiles)
          Sets the dedicated source used to read the profiles.
 void setSourceProfilesEvaluations(InputSupplier<? extends InputStream> source)
          Sets the dedicated source used to read the profiles evaluations.
 
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

XMCDASortingProblemReader

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


XMCDASortingProblemReader

public XMCDASortingProblemReader(InputSupplier<? extends InputStream> mainSource)
Creates a new reader with a main source. The reader will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.

Parameters:
mainSource - not null.

XMCDASortingProblemReader

public XMCDASortingProblemReader(InputSupplier<? extends InputStream> mainSource,
                                 XMCDAErrorsManager errorsManager)
Creates a new reader with a main source, and delegating error management to the given error manager in case of unexpected data read.

Parameters:
mainSource - not null.
errorsManager - not null.

XMCDASortingProblemReader

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

Parameters:
errorsManager - not null.

XMCDASortingProblemReader

public XMCDASortingProblemReader(URL mainSource)
Creates a new reader with a main source. The reader will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.

Parameters:
mainSource - not null.
Method Detail

setSourceCategoriesProfiles

public void setSourceCategoriesProfiles(InputSupplier<? extends InputStream> sourceCategoriesProfiles)
Sets the dedicated source used to read the categories and associated profiles.

Parameters:
sourceCategoriesProfiles - null for not set.

getSourceCategories

public InputSupplier<? extends InputStream> getSourceCategories()
Retrieves the source dedicated to categories.

Returns:
null if not set.

getSourceCategoriesProfiles

public InputSupplier<? extends InputStream> getSourceCategoriesProfiles()
Retrieves the source dedicated to definition of the categories through bounding profiles.

Returns:
null if not set.

getSourceProfiles

public InputSupplier<? extends InputStream> getSourceProfiles()
Retrieves the source dedicated to profiles.

Returns:
null if not set.

getSourceProfilesEvaluations

public InputSupplier<? extends InputStream> getSourceProfilesEvaluations()
Retrieves the source dedicated to profiles evaluations.

Returns:
null if not set.

readCategories

public NavigableSet<Category> readCategories()
                                      throws IOException,
                                             XmlException,
                                             InvalidInputException

Reads the categories from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readCategoriesProfiles

public ICatsAndProfs readCategoriesProfiles()
                                     throws IOException,
                                            XmlException,
                                            InvalidInputException

Reads the categories, together with their relations with the profiles defining them, from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readProfiles

public Set<Alternative> readProfiles()
                              throws IOException,
                                     XmlException,
                                     InvalidInputException

Reads the profiles from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully. Which profiles are returned depend on the chosen parsing method.

The returned set iteration order matches the order of the source.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.
See Also:
#setAlternativesParsingMethod(AlternativesParsingMethod)

readProfilesEvaluations

public IRdEvaluations readProfilesEvaluations()
                                       throws IOException,
                                              XmlException,
                                              InvalidInputException

Reads the profiles from the profiles evaluations source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully. This method returns every evaluations found in the relevant source. To restrict these evaluations to those concerning the profiles, the EvaluationsUtils class may be useful.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

setSourceCategories

public void setSourceCategories(InputSupplier<? extends InputStream> source)
Sets the dedicated source used to read the categories.

Parameters:
source - null for not set.

setSourceProfiles

public void setSourceProfiles(InputSupplier<? extends InputStream> sourceProfiles)
Sets the dedicated source used to read the profiles.

Parameters:
sourceProfiles - null for not set.

setSourceProfilesEvaluations

public void setSourceProfilesEvaluations(InputSupplier<? extends InputStream> source)
Sets the dedicated source used to read the profiles evaluations.

Parameters:
source - null for not set.

getSourceAlternatives

public InputSupplier<? extends InputStream> getSourceAlternatives()
Retrieves the source dedicated to alternatives.

Returns:
null if not set.

setSourceAlternatives

public void setSourceAlternatives(InputSupplier<? extends InputStream> sourceAlternatives)
Sets the dedicated source used to read alternatives.

Parameters:
sourceAlternatives - null for not set.

getSourceAlternativesEvaluations

public InputSupplier<? extends InputStream> getSourceAlternativesEvaluations()
Retrieves the source dedicated to alternatives evaluations.

Returns:
null if not set.

setSourceAlternativesEvaluations

public void setSourceAlternativesEvaluations(InputSupplier<? extends InputStream> sourceAlternativesEvaluations)
Sets the dedicated source used to read the evaluations of the alternatives.

Parameters:
sourceAlternativesEvaluations - null for not set.

getSourceCoalitions

public InputSupplier<? extends InputStream> getSourceCoalitions()
Retrieves the source dedicated to coalitions.

Returns:
null if not set.

setSourceCoalitions

public void setSourceCoalitions(InputSupplier<? extends InputStream> sourceCoalitions)
Sets the dedicated source used to read the coalitions.

Parameters:
sourceCoalitions - null for not set.

getSourceCriteria

public InputSupplier<? extends InputStream> getSourceCriteria()
Retrieves the source dedicated to criteria.

Returns:
null if not set.

setSourceCriteria

public void setSourceCriteria(InputSupplier<? extends InputStream> sourceCriteria)
Sets the dedicated source used to read the criteria.

Parameters:
sourceCriteria - null for not set.

getSourceMain

public InputSupplier<? extends InputStream> getSourceMain()
Retrieves the main source. This is used to read any type of object when the dedicated source is not set.

Returns:
null if not set.

setSourceMain

public void setSourceMain(InputSupplier<? extends InputStream> sourceMain)
Sets the main source used to read all types of objects for which no dedicated source is set.

Parameters:
sourceMain - null for not set.

getAlternativesParsingMethod

public XMCDAAlternatives.AlternativesParsingMethod getAlternativesParsingMethod()
Retrieves the parsing method used to read alternatives.

Returns:
the parsing method.

setAlternativesParsingMethod

public void setAlternativesParsingMethod(XMCDAAlternatives.AlternativesParsingMethod alternativesParsingMethod)
Sets the parsing method used to read alternatives and profiles.

Parameters:
alternativesParsingMethod - not null.

readAlternatives

public Set<Alternative> readAlternatives()
                                  throws IOException,
                                         XmlException,
                                         InvalidInputException

Reads the alternatives from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully. Which alternatives are returned depend on the chosen parsing method.

The returned set iteration order matches the order of the source.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.
See Also:
#setAlternativesParsingMethod(AlternativesParsingMethod)

readCoalitions

public ICoalitions readCoalitions()
                           throws IOException,
                                  XmlException,
                                  InvalidInputException

Reads the coalitions from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readCriteria

public Set<Criterion> readCriteria()
                            throws IOException,
                                   XmlException,
                                   InvalidInputException

Reads the criteria from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully. This method also sets the scales and thresholds in this object.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readScales

public Map<Criterion,IOrderedInterval> readScales()
                                           throws IOException,
                                                  XmlException,
                                                  InvalidInputException

Reads the scales from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readThresholds

public ICriteriaWithThresholds readThresholds()
                                       throws IOException,
                                              XmlException,
                                              InvalidInputException

Reads the thresholds from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

getXMCDA

public XMCDADoc.XMCDA getXMCDA(InputSupplier<? extends InputStream> source)
                        throws IOException,
                               XmlException
Retrieves the XMCDA document from the given source or from the main source if the given source is null. Ensures that it contains an XMCDA document conforming to the XMCDA schema.

Parameters:
source - may be null, in which case the main source in this object must be non null.
Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the contents of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.

getSourceAssignments

public InputSupplier<? extends InputStream> getSourceAssignments()
Retrieves the source dedicated to assignments.

Returns:
null if not set.

readAssignments

public IAssignmentsRead readAssignments()
                                 throws IOException,
                                        XmlException,
                                        InvalidInputException

Reads the assignments from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully, as a set of assignments of an alternative to a single category.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

setSourceAssignments

public void setSourceAssignments(InputSupplier<? extends InputStream> source)
Sets the dedicated source used to read assignments.

Parameters:
source - null for not set.

readAssignmentsToMultiple

public IAssignmentsToMultipleRead readAssignmentsToMultiple()
                                                     throws IOException,
                                                            XmlException,
                                                            InvalidInputException

Reads the assignments from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully, as a set of assignments of an alternative to multiple categories.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readAssignmentsWithCredibilities

public IAssignmentsWithCredibilitiesRead readAssignmentsWithCredibilities()
                                                                   throws IOException,
                                                                          XmlException,
                                                                          InvalidInputException

Reads the assignments from the dedicated source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully, as a set of assignments of an alternative to multiple categories with associated credibilities.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readEvaluations

public IRdEvaluations readEvaluations()
                               throws IOException,
                                      XmlException,
                                      InvalidInputException

Retrieves the union of the evaluations read from the alternatives evaluations source and the evaluations read from the profiles evaluations source, or from the the main source if the dedicated source is not set. The results of possible previous successful reads are re-used. If the two relevant sources are equal, the source is read only once. This method returns every evaluations found, with no distinction between REAL and FICTIVE alternatives.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readSortingData

public ISortingData readSortingData()
                             throws IOException,
                                    XmlException,
                                    InvalidInputException

Retrieves an aggregator object that gather several object type. The various sources set in this object are read from and the results gathered into the returned object. Results from previous successful reads are re-used instead of read again. In particular, if informations from all sources have been read already, no read occurs.

The returned object is writable.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readAlternativesEvaluations

public IRdEvaluations readAlternativesEvaluations()
                                           throws IOException,
                                                  XmlException,
                                                  InvalidInputException

Reads the evaluations from the alternatives evaluations source, or from the the main source if the dedicated source is not set, or retrieves the results of the previous read if it ended successfully. This method returns every evaluations found in the relevant source. To restrict these evaluations to those concerning the real alternatives, or to those concerning the profiles, the EvaluationsUtils class may be useful.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

equal

public boolean equal(InputSupplier<? extends InputStream> source1,
                     InputSupplier<? extends InputStream> source2)
Tests whether two sources are equal when replacing a null source with the main source. If both resulting sources are null, this method returns true. This method can be used to test whether the effective sources that this reader will use are equal.

Parameters:
source1 - may be null.
source2 - may be null.
Returns:
true iff both sources are equal from the point of view of this class.

readSortingPreferences

public ISortingPreferences readSortingPreferences()
                                           throws IOException,
                                                  XmlException,
                                                  InvalidInputException

Retrieves an aggregator object that gather several object type. The various sources set in this object are read from and the results gathered into the returned object. Results from previous successful reads are re-used instead of read again. In particular, if informations from all sources have been read already, no read occurs.

The returned object is writable.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readSortingResults

public ISortingResults readSortingResults()
                                   throws IOException,
                                          XmlException,
                                          InvalidInputException

Retrieves an aggregator object that gather several object type. The various sources set in this object are read from and the results gathered into the returned object. Results from previous successful reads are re-used instead of read again. In particular, if informations from all sources have been read already, no read occurs.

The returned object is writable.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readSortingResultsToMultiple

public ISortingResultsToMultiple readSortingResultsToMultiple()
                                                       throws IOException,
                                                              XmlException,
                                                              InvalidInputException

Retrieves an aggregator object that gather several object type. The various sources set in this object are read from and the results gathered into the returned object. Results from previous successful reads are re-used instead of read again. In particular, if informations from all sources have been read already, no read occurs.

The returned object is writable.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

readSortingResultsWithCredibilities

public ISortingResultsWithCredibilities readSortingResultsWithCredibilities()
                                                                     throws IOException,
                                                                            XmlException,
                                                                            InvalidInputException

Retrieves an aggregator object that gather several object type. The various sources set in this object are read from and the results gathered into the returned object. Results from previous successful reads are re-used instead of read again. In particular, if informations from all sources have been read already, no read occurs.

The returned object is writable.

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

Returns:
not null.
Throws:
IOException - if an exception happens while opening or closing the given reader, or while parsing the source.
XmlException - if an exception related to the xml correctness of the source happens while parsing the source, including if the given source does not contain a valid XMCDA document.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

clearCache

public void clearCache()
Clears the information cached in this class, resulting in the loss of any previously read information that had been remembered by this class. After this method is called, using any read method results in an effective read of the relevant source instead of a possible re-use of the cached data.


getSourceVersion

public String getSourceVersion()
Retrieves the XMCDA version of the documents read by this object.

Returns:
null if not uniform or nothing read yet.


Copyright © 2011. All Rights Reserved.