|
||||||||||
| 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.AssignmentsWithCredibilities
public class AssignmentsWithCredibilities
| Constructor Summary | |
|---|---|
AssignmentsWithCredibilities()
|
|
AssignmentsWithCredibilities(IAssignmentsWithCredibilitiesRead source)
Copy-constructor by value. |
|
| 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. |
Set<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. |
Set<Category> |
getCategories(Alternative alternative)
Retrieves the categories to which an alternative is assigned. |
Map<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. |
int |
hashCode()
|
boolean |
setCategories(Set<Category> categories)
|
boolean |
setCredibilities(Alternative alternative,
Map<Category,Double> credibilities)
Sets, replaces, or removes the assignment of an alternative and the associated degrees of credibility. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AssignmentsWithCredibilities()
public AssignmentsWithCredibilities(IAssignmentsWithCredibilitiesRead source)
source - not null.| Method Detail |
|---|
public Set<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 IAssignmentsToMultipleReadnull, empty iff no alternatives are assigned.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 Set<Alternative> getAlternatives()
IAssignmentsToMultipleRead
getAlternatives in interface IAssignmentsToMultipleReadnull.public boolean setCategories(Set<Category> categories)
public boolean clear()
clear in interface IAssignmentsWithCredibilitiespublic Map<Category,Double> getCredibilities(Alternative alternative)
IAssignmentsWithCredibilitiesReadnull
keys or values and only values greater than zero.
getCredibilities in interface IAssignmentsWithCredibilitiesReadalternative - 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)
IAssignmentsWithCredibilities
setCredibilities in interface IAssignmentsWithCredibilitiesalternative - 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. 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 boolean equals(Object obj)
IAssignmentsWithCredibilitiesReadIndicates whether the given object is equal to this one.
IOrderedAssignmentsToMultipleRead, this is true
iff the given object is a IAssignmentsWithCredibilitiesRead, does not implement the mentioned interface either,
and contains the same alternatives assigned to the same categories with the same credibilities and the same set
of overall categories as this object.IAssignmentsWithCredibilitiesRead, this method returns
false.
equals in interface IAssignmentsWithCredibilitiesReadequals in interface IAssignmentsToMultipleReadequals in class Objectobj - may be null.
true iff both objects are considered equal.public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic Set<Category> getCategories(Alternative alternative)
IAssignmentsToMultipleRead
getCategories in interface IAssignmentsToMultipleReadalternative - 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).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||