|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.jmcda.persist.xmcda2.aggregates.XMCDASortingProblemWriter
public class XMCDASortingProblemWriter
A class to write MCDA sorting problems to 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.
Although this class is meant to write characters rather than bytes, it uses output streams rather than writers. This
is because the writer hides the encoding used, which disables the possibility to correctly write the encoding used in
the XML header. Objects of this class use the UTF-8 encoding by default. See getSaveOptions().
| Constructor Summary | |
|---|---|
XMCDASortingProblemWriter()
Creates a new writer. |
|
XMCDASortingProblemWriter(OutputSupplier<? extends OutputStream> mainDestination)
Creates a new writer with a main destination. |
|
| Method Summary | |
|---|---|
void |
append(ICatsAndProfs catsAndProfs,
XMCDADoc.XMCDA xmcda)
|
void |
append(ICoalitions coalitions,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
|
void |
append(IOrderedAssignmentsToMultipleRead assignments,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
|
void |
append(IRdEvaluations evaluations,
Set<Alternative> alternativesOrder,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
|
void |
append(Map<DecisionMaker,ICoalitions> coalitions,
Set<DecisionMaker> dmsOrder,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
|
void |
append(Map<DecisionMaker,IRdEvaluations> profilesEvaluations,
Set<DecisionMaker> dmsOrder,
Set<Alternative> profilesOrder,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
|
void |
append(Set<Alternative> alternatives,
XAlternativeType.Enum type,
XMCDADoc.XMCDA xmcda)
|
void |
append(Set<Criterion> criteria,
Map<Criterion,IOrderedInterval> scales,
ICriteriaWithThresholds thresholds,
XMCDADoc.XMCDA xmcda)
|
void |
append(Set<DecisionMaker> dms,
XMCDADoc.XMCDA xmcda)
|
void |
appendAssignments(Map<DecisionMaker,? extends IOrderedAssignmentsToMultipleRead> assignments,
Set<DecisionMaker> dmsOrder,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
|
void |
appendAssignmentsWithCredibilities(Map<DecisionMaker,? extends IOrderedAssignmentsWithCredibilitiesRead> assignments,
Set<DecisionMaker> dmsOrder,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
|
void |
appendData(ISortingData data,
ICriteriaWithThresholds thresholds,
XMCDADoc.XMCDA xmcda)
|
void |
appendGroupData(IGroupSortingData data,
ICriteriaWithThresholds thresholds,
XMCDADoc.XMCDA xmcda)
|
void |
appendGroupPreferences(IGroupSortingPreferences data,
XMCDADoc.XMCDA xmcda)
|
void |
appendPreferences(ISortingPreferences data,
XMCDADoc.XMCDA xmcda)
|
void |
appendWithCredibilities(IOrderedAssignmentsWithCredibilitiesRead assignments,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
|
boolean |
doesValidate()
Retrieves the information whether this object only accepts to write valid documents. |
OutputSupplier<? extends OutputStream> |
getDestinationAlternatives()
Retrieves the destination dedicated to alternatives. |
OutputSupplier<? extends OutputStream> |
getDestinationAlternativesEvaluations()
Retrieves the destination dedicated to alternatives evaluations. |
OutputSupplier<? extends OutputStream> |
getDestinationAssignments()
Retrieves the destination dedicated to assignments. |
OutputSupplier<? extends OutputStream> |
getDestinationCategories()
Retrieves the destination dedicated to categories. |
OutputSupplier<? extends OutputStream> |
getDestinationCategoriesProfiles()
Retrieves the destination dedicated to definition of the categories through bounding profiles. |
OutputSupplier<? extends OutputStream> |
getDestinationCoalitions()
Retrieves the destination dedicated to coalitions. |
OutputSupplier<? extends OutputStream> |
getDestinationCriteria()
Retrieves the destination dedicated to criteria. |
OutputSupplier<? extends OutputStream> |
getDestinationMain()
Retrieves the main destination. |
OutputSupplier<? extends OutputStream> |
getDestinationProfiles()
Retrieves the destination dedicated to profiles. |
OutputSupplier<? extends OutputStream> |
getDestinationProfilesEvaluations()
Retrieves the destination dedicated to profiles evaluations. |
XmlOptions |
getSaveOptions()
Retrieves a writable view of the options used to save XML streams. |
void |
setDestinationAlternatives(OutputSupplier<? extends OutputStream> destinationAlternatives)
Sets the dedicated destination used to write alternatives. |
void |
setDestinationAlternativesEvaluations(OutputSupplier<? extends OutputStream> destinationAlternativesEvaluations)
Sets the dedicated destination used to write the evaluations of the alternatives. |
void |
setDestinationAssignments(OutputSupplier<? extends OutputStream> destination)
Sets the dedicated destination used to write assignments. |
void |
setDestinationCategories(OutputSupplier<? extends OutputStream> destination)
Sets the dedicated destination used to write the categories. |
void |
setDestinationCategoriesProfiles(OutputSupplier<? extends OutputStream> destinationCategoriesProfiles)
Sets the dedicated destination used to write the categories and associated profiles. |
void |
setDestinationCoalitions(OutputSupplier<? extends OutputStream> destinationCoalitions)
Sets the dedicated destination used to write the coalitions. |
void |
setDestinationCriteria(OutputSupplier<? extends OutputStream> destinationCriteria)
Sets the dedicated destination used to write the criteria. |
void |
setDestinationMain(OutputSupplier<? extends OutputStream> destinationMain)
Sets the main destination used to write all types of objects for which no dedicated destination is set. |
void |
setDestinationProfiles(OutputSupplier<? extends OutputStream> destinationProfiles)
Sets the dedicated destination used to write the profiles. |
void |
setDestinationProfilesEvaluations(OutputSupplier<? extends OutputStream> destination)
Sets the dedicated destination used to write the profiles evaluations. |
void |
setValidate(boolean validate)
Enables or disables the check for validation before writing any document. |
void |
write(XMCDADoc doc,
OutputSupplier<? extends OutputStream> destination)
Writes the given XMCDA document to the given destination or to the main destination if the given destination is null. |
void |
writeAssignments(ISortingAssignments data)
|
void |
writeAssignments(ISortingAssignmentsToMultiple data)
|
void |
writeAssignmentsWithCredibilities(ISortingAssignmentsWithCredibilities data)
|
void |
writeData(ISortingData data)
|
void |
writeGroupAssignments(IGroupSortingAssignments data)
|
void |
writeGroupAssignments(IGroupSortingAssignmentsToMultiple data)
|
void |
writeGroupAssignmentsWithCredibilities(IGroupSortingAssignmentsWithCredibilities data)
|
void |
writeGroupPreferences(IGroupSortingPreferences data)
|
void |
writeGroupResults(IGroupSortingResults data)
|
void |
writeGroupResults(IGroupSortingResultsToMultiple data)
|
void |
writeGroupResultsWithCredibilities(IGroupSortingResultsWithCredibilities data)
|
void |
writePreferences(ISortingPreferences data)
|
void |
writeResults(ISortingResults data)
|
void |
writeResults(ISortingResultsToMultiple data)
|
void |
writeResultsWithCredibilities(ISortingResultsWithCredibilities data)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMCDASortingProblemWriter()
public XMCDASortingProblemWriter(OutputSupplier<? extends OutputStream> mainDestination)
mainDestination - not null.| Method Detail |
|---|
public XmlOptions getSaveOptions()
null.
public void writeData(ISortingData data)
throws IOException
IOException
public void append(ICatsAndProfs catsAndProfs,
XMCDADoc.XMCDA xmcda)
public void append(IRdEvaluations evaluations,
Set<Alternative> alternativesOrder,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
public void append(Set<Criterion> criteria,
Map<Criterion,IOrderedInterval> scales,
ICriteriaWithThresholds thresholds,
XMCDADoc.XMCDA xmcda)
public void append(Set<Alternative> alternatives,
XAlternativeType.Enum type,
XMCDADoc.XMCDA xmcda)
public void setDestinationCategoriesProfiles(OutputSupplier<? extends OutputStream> destinationCategoriesProfiles)
destinationCategoriesProfiles - null for not set.public OutputSupplier<? extends OutputStream> getDestinationCategories()
null if not set.public OutputSupplier<? extends OutputStream> getDestinationCategoriesProfiles()
null if not set.public OutputSupplier<? extends OutputStream> getDestinationProfiles()
null if not set.public OutputSupplier<? extends OutputStream> getDestinationProfilesEvaluations()
null if not set.public void setDestinationCategories(OutputSupplier<? extends OutputStream> destination)
destination - null for not set.public void setDestinationProfiles(OutputSupplier<? extends OutputStream> destinationProfiles)
destinationProfiles - null for not set.public void setDestinationProfilesEvaluations(OutputSupplier<? extends OutputStream> destination)
destination - null for not set.public OutputSupplier<? extends OutputStream> getDestinationAlternatives()
null if not set.public void setDestinationAlternatives(OutputSupplier<? extends OutputStream> destinationAlternatives)
destinationAlternatives - null for not set.public OutputSupplier<? extends OutputStream> getDestinationAlternativesEvaluations()
null if not set.public void setDestinationAlternativesEvaluations(OutputSupplier<? extends OutputStream> destinationAlternativesEvaluations)
destinationAlternativesEvaluations - null for not set.public OutputSupplier<? extends OutputStream> getDestinationCoalitions()
null if not set.public void setDestinationCoalitions(OutputSupplier<? extends OutputStream> destinationCoalitions)
destinationCoalitions - null for not set.public OutputSupplier<? extends OutputStream> getDestinationCriteria()
null if not set.public void setDestinationCriteria(OutputSupplier<? extends OutputStream> destinationCriteria)
destinationCriteria - null for not set.public OutputSupplier<? extends OutputStream> getDestinationMain()
null if not set.public void setDestinationMain(OutputSupplier<? extends OutputStream> destinationMain)
destinationMain - null for not set.
public void write(XMCDADoc doc,
OutputSupplier<? extends OutputStream> destination)
throws IOException
null. The document must be valid, except if this object is specifically set to not
validate documents.
doc - not null, must conform to the XMCDA schema.destination - may be null, in which case the main destination in this object must be non
null.
IOException - if an exception happens while opening or closing the given writer, or while writing to the
destination.setValidate(boolean)public boolean doesValidate()
true.
true if this object validates documents before writing them.public void setValidate(boolean validate)
true, thus
this object validates each document before writing them. It is not recommanded to disable validation but it can
be useful for debug.
validate - false to allow writing invalid documents.public OutputSupplier<? extends OutputStream> getDestinationAssignments()
null if not set.public void setDestinationAssignments(OutputSupplier<? extends OutputStream> destination)
destination - null for not set.
public void writePreferences(ISortingPreferences data)
throws IOException
IOException
public void appendPreferences(ISortingPreferences data,
XMCDADoc.XMCDA xmcda)
public void writeAssignments(ISortingAssignments data)
throws IOException
IOException
public void appendWithCredibilities(IOrderedAssignmentsWithCredibilitiesRead assignments,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
public void append(ICoalitions coalitions,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
public void append(IOrderedAssignmentsToMultipleRead assignments,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
public void writeAssignments(ISortingAssignmentsToMultiple data)
throws IOException
IOException
public void writeResults(ISortingResults data)
throws IOException
IOException
public void writeResults(ISortingResultsToMultiple data)
throws IOException
IOException
public void writeResultsWithCredibilities(ISortingResultsWithCredibilities data)
throws IOException
IOException
public void writeAssignmentsWithCredibilities(ISortingAssignmentsWithCredibilities data)
throws IOException
IOException
public void writeGroupPreferences(IGroupSortingPreferences data)
throws IOException
IOException
public void appendGroupPreferences(IGroupSortingPreferences data,
XMCDADoc.XMCDA xmcda)
public void appendGroupData(IGroupSortingData data,
ICriteriaWithThresholds thresholds,
XMCDADoc.XMCDA xmcda)
public void appendData(ISortingData data,
ICriteriaWithThresholds thresholds,
XMCDADoc.XMCDA xmcda)
public void append(Map<DecisionMaker,IRdEvaluations> profilesEvaluations,
Set<DecisionMaker> dmsOrder,
Set<Alternative> profilesOrder,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
public void append(Map<DecisionMaker,ICoalitions> coalitions,
Set<DecisionMaker> dmsOrder,
Set<Criterion> criteriaOrder,
XMCDADoc.XMCDA xmcda)
public void append(Set<DecisionMaker> dms,
XMCDADoc.XMCDA xmcda)
public void writeGroupAssignments(IGroupSortingAssignments data)
throws IOException
IOException
public void appendAssignments(Map<DecisionMaker,? extends IOrderedAssignmentsToMultipleRead> assignments,
Set<DecisionMaker> dmsOrder,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
public void writeGroupAssignments(IGroupSortingAssignmentsToMultiple data)
throws IOException
IOException
public void writeGroupAssignmentsWithCredibilities(IGroupSortingAssignmentsWithCredibilities data)
throws IOException
IOException
public void appendAssignmentsWithCredibilities(Map<DecisionMaker,? extends IOrderedAssignmentsWithCredibilitiesRead> assignments,
Set<DecisionMaker> dmsOrder,
Set<Alternative> alternativesOrder,
XMCDADoc.XMCDA xmcda)
public void writeGroupResults(IGroupSortingResults data)
throws IOException
IOException
public void writeGroupResults(IGroupSortingResultsToMultiple data)
throws IOException
IOException
public void writeGroupResultsWithCredibilities(IGroupSortingResultsWithCredibilities data)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||