|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.jmcda.structure.sorting.assignment.credibilities.OrderedAssignmentsWithCredibilitiesFromRead
public class OrderedAssignmentsWithCredibilitiesFromRead
| Constructor Summary | |
|---|---|
OrderedAssignmentsWithCredibilitiesFromRead(IOrderedAssignmentsWithCredibilitiesRead delegate)
|
|
| Method Summary | |
|---|---|
boolean |
clear()
|
boolean |
equals(Object obj)
Indicates whether the given object is equal to this one. |
Set<Alternative> |
getAlternatives()
Retrieves a read-only view of the assigned alternatives. |
Set<Alternative> |
getAlternatives(Category category)
Retrieves a read-only view, or copy, of the alternatives that are assigned to the given category, or to a set of categories including the given category. |
NavigableSet<Category> |
getCategories()
Retrieves a (possibly read-only) copy of a set containing at least all the categories to which at least one alternative is assigned. |
NavigableSet<Category> |
getCategories(Alternative alternative)
Retrieves the categories to which an alternative is assigned. |
NavigableMap<Category,Double> |
getCredibilities(Alternative alternative)
Retrieves a (possibly read-only) copy of the categories an alternative is assigned to together with their associated credibility degrees, ordered from the worst category to the best category the given alternative is assigned to. |
int |
hashCode()
|
boolean |
setCategories(SortedSet<Category> categories)
Sets the categories and the order of the categories in this object. |
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 |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedAssignmentsWithCredibilitiesFromRead(IOrderedAssignmentsWithCredibilitiesRead delegate)
| Method Detail |
|---|
public boolean clear()
clear in interface IOrderedAssignmentsWithCredibilitiespublic boolean equals(Object obj)
IOrderedAssignmentsWithCredibilitiesRead
Indicates whether the given object is equal to this one. This is true iff the given object is a
IOrderedAssignmentsWithCredibilitiesRead, contains the same alternatives assigned to the same categories with the
same credibilities, and contains the same set of overall categories as this object in the same order.
equals in interface IAssignmentsWithCredibilitiesReadequals in interface IOrderedAssignmentsWithCredibilitiesReadequals in interface IAssignmentsToMultipleReadequals in interface IOrderedAssignmentsToMultipleReadequals in class Objectobj - may be null.
true iff both objects are considered equal.public Set<Alternative> getAlternatives()
IAssignmentsToMultipleRead
getAlternatives in interface IAssignmentsToMultipleReadnull.public Set<Alternative> getAlternatives(Category category)
IAssignmentsToMultipleReadRetrieves a read-only view, or copy, of the alternatives that are assigned to the given category, or to a set of categories including the given category.
If the given category is not in the set returned by IAssignmentsToMultipleRead.getCategories(), the returned set is empty.
getAlternatives in interface IAssignmentsToMultipleReadcategory - not null.
null.public NavigableSet<Category> getCategories()
IAssignmentsToMultipleReadRetrieves a (possibly read-only) copy of a set containing at least all the categories to which at least one alternative is assigned. Depending on the implementing object, the returned set may be larger than this. It may for example contain all the categories that are available in some context, even when the alternatives assignments do not cover the whole set of possibilities.
The returned set is a copy: if the assignment related to the given alternative later change, this change is not reflected to the object this method returns.
getCategories in interface IAssignmentsToMultipleReadgetCategories in interface IOrderedAssignmentsToMultipleReadnull, empty iff no alternatives are assigned.public NavigableSet<Category> getCategories(Alternative alternative)
IAssignmentsToMultipleRead
getCategories in interface IAssignmentsToMultipleReadgetCategories in interface IOrderedAssignmentsToMultipleReadalternative - not null.
null iff
the alternative is not assigned. The returned set is never empty. The returned set is a copy (if the
assignment related to the given alternative later change, this change is not reflected to the object this
method returns).public int hashCode()
hashCode in class Objectpublic boolean setCategories(SortedSet<Category> categories)
IOrderedAssignmentsWithCredibilitiesSets the categories and the order of the categories in this object.
Caution should be execised when using this method on a non empty object. The simple case is when the given categories ordering is compatible with the ordering already used. If on the countrary the given categories order is not compatible with the already given ordered assignments, the assignments will be changed to reflect the new order. The user should check whether the order is compatible before using this method if she does not want this to happen.
setCategories in interface IOrderedAssignmentsWithCredibilitiescategories - null to remove the associated categories (all the orderings are lost), authorized only
when no assignments are contained in this object. Must be a superset of the categories already used.
true iff the categories changed.public NavigableMap<Category,Double> getCredibilities(Alternative alternative)
IOrderedAssignmentsWithCredibilitiesRead
Retrieves a (possibly read-only) copy of the categories an alternative is assigned to together with their
associated credibility degrees, ordered from the worst category to the best category the given alternative is
assigned to. That ordering relates to the preference order on the categories and not to the degrees of
credibilities, i.e. it is usually not ordered by degree of credibility. The order is compatible with the ordering
given by IAssignmentsToMultipleRead.getCategories().
getCredibilities in interface IAssignmentsWithCredibilitiesReadgetCredibilities in interface IOrderedAssignmentsWithCredibilitiesReadalternative - not null.
null iff the given alternative is not assigned, otherwise, a map containing at least one
entry.
public boolean setCredibilities(Alternative alternative,
Map<Category,Double> credibilities)
IOrderedAssignmentsWithCredibilitiesIAssignmentsToMultipleRead.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.
setCredibilities in interface IOrderedAssignmentsWithCredibilitiesalternative - 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 IAssignmentsToMultipleRead.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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||