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

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

public class XMCDAGroupSortingProblemReader
extends XMCDAHelperWithVarious

TODO document properly.

A class to read MCDA group 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 credibilities. This class supports the case of a group of decision makers.

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

Constructor Summary
XMCDAGroupSortingProblemReader()
          Creates a new reader which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.
XMCDAGroupSortingProblemReader(InputSupplier<? extends InputStream> mainSource)
          Creates a new reader with a main source.
XMCDAGroupSortingProblemReader(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.
XMCDAGroupSortingProblemReader(URL mainSource)
          Creates a new reader with a main source.
XMCDAGroupSortingProblemReader(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> getSourceDms()
          Retrieves the source dedicated to the decision makers.
 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)
           
 Map<DecisionMaker,IAssignmentsToMultipleRead> readAllAssignmentsToMultiple()
           Reads the assignments per decision maker 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.
 Map<DecisionMaker,ICoalitions> readAllCoalitions()
           Reads the coalitions per decision maker 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.
 Map<DecisionMaker,IOrderedAssignmentsRead> readAllOrderedAssignments()
           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.
 Map<DecisionMaker,IRdEvaluations> readAllProfilesEvaluations()
           Reads the profiles evaluations per decision maker 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<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 alternatives evaluations 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.
 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.
 Set<DecisionMaker> readDms()
           Reads the decision makers 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()
           Reads the evaluations 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.
 IGroupSortingResults readGroupResults()
           Retrieves an aggregator object that gather several object type.
 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 evaluations 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.
 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.
 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.
 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 setSourceDms(InputSupplier<? extends InputStream> source)
          Sets the dedicated source used to read the decision makers.
 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

XMCDAGroupSortingProblemReader

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


XMCDAGroupSortingProblemReader

public XMCDAGroupSortingProblemReader(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.

XMCDAGroupSortingProblemReader

public XMCDAGroupSortingProblemReader(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.

XMCDAGroupSortingProblemReader

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

Parameters:
errorsManager - not null.

XMCDAGroupSortingProblemReader

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

getSourceAssignments

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

Returns:
null if not set.

getSourceDms

public InputSupplier<? extends InputStream> getSourceDms()
Retrieves the source dedicated to the decision makers.

Returns:
null if not set.

setSourceAssignments

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

Parameters:
source - null for not set.

setSourceDms

public void setSourceDms(InputSupplier<? extends InputStream> source)
Sets the dedicated source used to read the decision makers.

Parameters:
source - null for not set.

readGroupResults

public IGroupSortingResults readGroupResults()
                                      throws XmlException,
                                             IOException,
                                             InvalidInputException

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

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.

readAllProfilesEvaluations

public Map<DecisionMaker,IRdEvaluations> readAllProfilesEvaluations()
                                                             throws IOException,
                                                                    XmlException,
                                                                    InvalidInputException

Reads the profiles evaluations per decision maker 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.

readDms

public Set<DecisionMaker> readDms()
                           throws IOException,
                                  XmlException,
                                  InvalidInputException

Reads the decision makers 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.

readAllCoalitions

public Map<DecisionMaker,ICoalitions> readAllCoalitions()
                                                 throws IOException,
                                                        XmlException,
                                                        InvalidInputException

Reads the coalitions per decision maker 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.

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.

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.

readProfilesEvaluations

public IRdEvaluations readProfilesEvaluations()
                                       throws IOException,
                                              XmlException,
                                              InvalidInputException

Reads the profiles evaluations 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 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.

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.

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.

readAlternativesEvaluations

public IRdEvaluations readAlternativesEvaluations()
                                           throws IOException,
                                                  XmlException,
                                                  InvalidInputException

Reads the alternatives evaluations 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 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.

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
Throws:
IOException
XmlException

readAllAssignmentsToMultiple

public Map<DecisionMaker,IAssignmentsToMultipleRead> readAllAssignmentsToMultiple()
                                                                           throws IOException,
                                                                                  XmlException,
                                                                                  InvalidInputException

Reads the assignments per decision maker 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.

readAllOrderedAssignments

public Map<DecisionMaker,IOrderedAssignmentsRead> readAllOrderedAssignments()
                                                                     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.

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.

This method also reads other data as is required to transform the original assignments read into the requested type. If no differentiated assignments information is found, equal assignments for each decision makers in the set of read decison makers are returned from the set of shared assignments.

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

Reads the evaluations 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 returns every evaluations found in the relevant source, with no distinction between REAL and FICTIVE alternatives.

This method may not be used if the dedicated source for alternatives evaluations and the dedicated source for profiles evaluations are both set and are not equal, because in such a situation which source to use is undetermined. In positive terms, at least one dedicated source must be null or they must be equal. If both dedicated sources are null, this method uses the main source. If it is null as well, an empty object is returned.

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.

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.