|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.jmcda.structure.sorting.assignment.VersatileOrderedAssignments
public class VersatileOrderedAssignments
An ordered equivalent to VersatileAssignments.
The orderings returned by this object are always compatible with the order given by the categories. Hence, when the categories are changed, it is possible that the order changes. Read carefully the contract of the relevant methods.
| Constructor Summary | |
|---|---|
VersatileOrderedAssignments()
|
|
VersatileOrderedAssignments(IOrderedAssignmentsToMultipleRead assignments)
|
|
VersatileOrderedAssignments(IOrderedAssignmentsWithCredibilitiesRead assignments)
|
|
VersatileOrderedAssignments(VersatileOrderedAssignments copy)
Copy constructor by value. |
|
| Method Summary | |
|---|---|
boolean |
clear()
|
Set<Alternative> |
getAlternatives()
|
Set<Alternative> |
getAlternatives(Category category)
|
Set<Category> |
getCategories()
|
Set<Category> |
getCategories(Alternative alternative)
|
NavigableSet<Category> |
getCategoriesSorted()
|
NavigableSet<Category> |
getCategoriesSorted(Alternative alternative)
|
Category |
getCategory(Alternative alternative)
The alternative must not be assigned to more than one category (otherwise an exception is raised). |
Map<Category,Double> |
getCredibilities(Alternative alternative)
|
NavigableMap<Category,Double> |
getCredibilitiesSorted(Alternative alternative)
|
boolean |
isCrisp()
|
NavigableMap<Category,Double> |
remove(Alternative alternative)
|
boolean |
setCategories(Alternative alternative,
Set<Category> categories)
Sets, replaces, or removes the assignment of an alternative. |
boolean |
setCategories(SortedSet<Category> categories)
|
boolean |
setCategory(Alternative alternative,
Category category)
Sets, replaces, or removes the assignment of an alternative. |
boolean |
setCredibilities(Alternative alternative,
Map<Category,Double> credibilities)
Sets, replaces, or removes the assignment of an alternative and the associated degrees of credibility. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VersatileOrderedAssignments()
public VersatileOrderedAssignments(VersatileOrderedAssignments copy)
copy - not null. The source data to be copied into this object.public VersatileOrderedAssignments(IOrderedAssignmentsWithCredibilitiesRead assignments)
public VersatileOrderedAssignments(IOrderedAssignmentsToMultipleRead assignments)
| Method Detail |
|---|
public boolean setCategories(SortedSet<Category> categories)
public boolean isCrisp()
true iff every assigned alternatives are assigned to exactly one category (thus with a
credibility degree of one). Returns false iff at least one alternative is assigned to more
than one category.
public boolean setCredibilities(Alternative alternative,
Map<Category,Double> credibilities)
getCategories(). A zero value as a degree of credibility is considered as
equivalent to a missing entry: it is interpreted as meaning that the given alternative is not assigned to the
corresponding category.
alternative - not null.credibilities - null or empty to assign the alternative to no category, i.e., to remove the assignment of
the given alternative. The map entries may not contain a null key or value, the values
must be positive or zero, the categories must be contained in getCategories(). If the map
contains only zeroes, it is considered empty.
true iff the call changed the assignments, i.e., iff the assignment existed and has been
removed, or existed and has changed (be it a change in some credibility degrees or a change of category),
or did not exist and has been added.public NavigableMap<Category,Double> remove(Alternative alternative)
public boolean setCategories(Alternative alternative,
Set<Category> categories)
Sets, replaces, or removes the assignment of an alternative. The given categories ordering must have been defined.
When this method is used to add an assignment, evenly shared degrees of credibility are added automatically for
compatibility with getCredibilities(Alternative).
alternative - not null.categories - null or empty to assign the alternative to no category, i.e., to remove the assignment of
the given alternative. Otherwise, must be a subset of the categories returned by
getCategories().
true iff the call changed the assignments, i.e. true iff the given alternative was assigned
and the assignment has been removed, or was assigned to a not identical set of categories, or was not
assigned and has been.public Map<Category,Double> getCredibilities(Alternative alternative)
public NavigableMap<Category,Double> getCredibilitiesSorted(Alternative alternative)
public Set<Category> getCategories(Alternative alternative)
public boolean setCategory(Alternative alternative,
Category category)
getCategoriesSorted() would not be a superset of the used categories any more.
alternative - not null.category - null to remove the assignment.
true iff the call changed the assignments, i.e. true iff the given alternative
was assigned and the assignment has been removed, or was assigned to a different category, or was not
assigned and has been assigned to a category.public Category getCategory(Alternative alternative)
The alternative must not be assigned to more than one category (otherwise an exception is raised). Note that this object needs this supplementary condition and thus can't implement correctly the interface for the single category case, because it already implements more complex cases, hence there is no guarantee that all alternatives are assigned to no more than one category.
alternative - not null.
null iff this alternative is not
assigned.public Set<Category> getCategories()
public Set<Alternative> getAlternatives(Category category)
public NavigableSet<Category> getCategoriesSorted()
public Set<Alternative> getAlternatives()
public NavigableSet<Category> getCategoriesSorted(Alternative alternative)
public boolean clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||