|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.jmcda.structure.sorting.assignment.OrderedAssignments
public class OrderedAssignments
| Constructor Summary | |
|---|---|
OrderedAssignments()
|
|
| 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, if it exists, the category to which an alternative is assigned as a singleton set. |
Category |
getCategory(Alternative alternative)
|
int |
hashCode()
|
boolean |
setCategories(SortedSet<Category> categories)
Sets the categories and the order of the categories in this object. |
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 OrderedAssignments()
| Method Detail |
|---|
public Category getCategory(Alternative alternative)
getCategory in interface IAssignmentsReadalternative - not null.
null iff this alternative is not
assigned.public Set<Alternative> getAlternatives()
IAssignmentsToMultipleRead
getAlternatives in interface IAssignmentsToMultipleReadnull.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)
IOrderedAssignmentsReadIOrderedAssignmentsToMultipleRead 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 IAssignmentsToMultipleReadgetCategories in interface IOrderedAssignmentsReadgetCategories in interface IOrderedAssignmentsToMultipleReadalternative - not null.
null iff the alternative is not assigned. The returned set is immutable (if the assignment
related to the given alternative later change, this change is not reflected to the object this method
returns).public boolean setCategories(SortedSet<Category> categories)
IOrderedAssignmentsWriteableSets the categories and the order of the categories in this object.
Caution should be used 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 IOrderedAssignmentsWriteablecategories - 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 boolean setCategory(Alternative alternative,
Category category)
IOrderedAssignments
setCategory in interface IOrderedAssignmentsalternative - not null.category - null or empty to assign the alternative to no category, i.e., to remove the assignment of
the given alternative. Otherwise, must be contained in the categories returned by
IAssignmentsToMultipleRead.getCategories().
true iff the call changed the assignments, i.e. true if 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.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 boolean clear()
clear in interface IOrderedAssignmentsWriteablepublic 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 interface IOrderedAssignmentsToMultipleReadequals in class Objectobj - may be null.
true iff both objects are considered equal.public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||