|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.xmcda_oo.structure.category.Assignments
public class Assignments
This object holds assignments of alternatives to categories. Two such objects are equal iff they contain the same set of alternatives, each assigned to the same categories.
| Constructor Summary | |
|---|---|
Assignments()
|
|
Assignments(Assignments assignments)
|
|
Assignments(IAssignmentsToMultipleRead assignments)
|
|
| Method Summary | |
|---|---|
boolean |
addAssignment(Alternative alternative,
ICategory destination)
Assigns the given alternative to the given category. |
boolean |
equals(Object obj)
|
Set<ICategory> |
getAllCategories()
|
Set<Alternative> |
getAlternatives(ICategory category)
|
Set<Alternative> |
getAssignedAlternatives()
|
Set<ICategory> |
getCategories(Alternative alternative)
|
ICategory |
getCategory(Alternative alternative)
May use it only if this object is not multi-categories (see isMultiCats()). |
int |
hashCode()
|
boolean |
isMultiCats()
|
void |
removeAssignment(Alternative alternative,
ICategory destination)
The designated assignment must exist in this object. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Assignments(Assignments assignments)
public Assignments()
public Assignments(IAssignmentsToMultipleRead assignments)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
public boolean addAssignment(Alternative alternative,
ICategory destination)
alternative - an alternative, not null.destination - the category where to assign this alternative.
true if this assignment has been added, i.e. it did not exist already.public Set<Alternative> getAlternatives(ICategory category)
category - the category of interest. Not null.
null, but
may be empty (if the category has no assignments inside, i.e. it is not one of the categories returned by
getAllCategories()).public Set<ICategory> getCategories(Alternative alternative)
alternative - the alternative of interest. Not null.
null,
but may be empty.public Set<ICategory> getAllCategories()
null, empty iff this object holds no assignments.public Set<Alternative> getAssignedAlternatives()
null, empty iff this object holds no assignments.
public void removeAssignment(Alternative alternative,
ICategory destination)
The designated assignment must exist in this object.
Removes an assignment. If the given alternative is assigned to more than one categories, the other categories to which this alternative is assigned are left untouched.
alternative - the alternative to remove from the given category.destination - the category from which to remove the alternative.public boolean isMultiCats()
true iff at least one alternative is assigned to more than one category.public ICategory getCategory(Alternative alternative)
isMultiCats()).
alternative - not null.
null iff the given alternative is not assigned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||