|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.jmcda.structure.sorting.assignment.Assignments
public class Assignments
| Constructor Summary | |
|---|---|
Assignments()
|
|
| 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, if it exists, the category to which an alternative is assigned as a singleton set. |
Category |
getCategory(Alternative alternative)
|
int |
hashCode()
|
boolean |
setCategory(Alternative alternative,
Category category)
Sets, replaces, or removes the assignment of an alternative. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Assignments()
| 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 Category getCategory(Alternative alternative)
getCategory in interface IAssignmentsReadalternative - not null.
null iff this alternative is not
assigned.public boolean clear()
clear in interface IAssignments
public boolean setCategory(Alternative alternative,
Category category)
IAssignments
setCategory in interface IAssignmentsalternative - 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 boolean equals(Object obj)
IAssignmentsToMultipleRead
Indicates whether the given object is equal to this one. Supposing this object does not implement
IAssignmentsWithCredibilitiesRead nor IOrderedAssignmentsToMultipleRead, this is
true iff the given object is a IAssignmentsToMultipleRead, does not implement any of these mentioned
interfaces either, and contains the same alternatives assigned to the same categories and the same set of overall
categories as this object.
Other cases are more subtle. Objects implementing IAssignmentsToMultipleRead may be categorized, according to
their capabilities, into four classes: objects having no credibilities and no ordered assignments, objects having
credibilities but no ordered assignments, objects having ordered assignments but no credibilities, and objects
having both credibilities and ordered assignments. It is meaningless to compare objects belonging to different
classes of capabilities and the equality test between objects which are non homogeneous in that sense return
false. If this object and the compared object both have credibilities, a supplementary condition is
added for the objects to be equal, namely that the assignments must be associated with the same credibilities to
the same categories. If this object and the compared object both are ordered, the added condition is that the set
of categories contained in the objects must have the same order. Both supplementary conditions are required if
the objects being tested for equality are ordered and have credibilities.
equals in interface IAssignmentsToMultipleReadequals in class Objectobj - may be null.
true iff both objects are considered equal.public int hashCode()
hashCode in class Objectpublic Set<Category> getCategories(Alternative alternative)
IAssignmentsReadIAssignmentsToMultipleRead interface. The method
IAssignmentsRead.getCategory(Alternative) is functionally equivalent and should be preferred over this one as it is
clearer.
getCategories in interface IAssignmentsReadgetCategories in interface IAssignmentsToMultipleReadalternative - not null.
null iff the alternative is not assigned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||