org.argouml.model.uml.behavioralelements.collaborations
Class CollaborationsHelper

java.lang.Object
  |
  +--org.argouml.model.uml.behavioralelements.collaborations.CollaborationsHelper

public class CollaborationsHelper
extends java.lang.Object

Helper class for UML BehavioralElements::Collaborations Package. Current implementation is a placeholder.

Since:
ARGO0.11.2

Method Summary
 void addBase(ru.novosoft.uml.behavior.collaborations.MClassifierRole role, ru.novosoft.uml.foundation.core.MClassifier base)
          Adds a base to the given classifierrole.
 java.util.Collection allAvailableContents(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
          Returns all available contents for a given classifierrole as defined in section 2.10.3.3 of the UML 1.3 spec.
 java.util.Collection allAvailableFeatures(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
          Returns all available features for a given classifierrole as defined in section 2.10.3.3 of the UML 1.3 spec.
 java.util.Collection getAllClassifierRoles()
          Returns all classifierroles found in the projectbrowser model
 java.util.Collection getAllClassifierRoles(ru.novosoft.uml.foundation.core.MNamespace ns)
          Returns all classifierroles found in this namespace and in its children
 java.util.Collection getAllPossibleActivators(ru.novosoft.uml.behavior.collaborations.MMessage mes)
          Returns all possible activators for some message mes.
 java.util.Collection getAllPossibleAssociationRoles(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
          Returns all associations the bases of the classifierrole has, thereby forming the set of associationroles the classifierrole can use.
 java.util.Collection getAllPossibleBases(ru.novosoft.uml.behavior.collaborations.MAssociationRole role)
          Returns all possible bases for some associationrole taking into account the wellformednessrules as defined in section 2.10.3 of the UML 1.3 spec.
 java.util.Collection getAllPossibleBases(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
          Returns all possible bases for some classifierrole taking into account the wellformednessrules as defined in section 2.10.3 of the UML 1.3 spec.
 java.util.Collection getAllPossiblePredecessors(ru.novosoft.uml.behavior.collaborations.MMessage message)
          Returns all possible predecessors for some message, taking into account the wellformednessrules as defined in section 2.10 of the UML spec.
 ru.novosoft.uml.behavior.collaborations.MAssociationRole getAssocationRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole from, ru.novosoft.uml.behavior.collaborations.MClassifierRole to)
          Returns the first found associationrole between two classifierroles.
 java.util.Collection getClassifierRoles(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
          Returns all classifierroles associated via associationroles to some classifierrole role
static CollaborationsHelper getHelper()
          Singleton instance access method.
 boolean hasAsActivator(ru.novosoft.uml.behavior.collaborations.MMessage message, ru.novosoft.uml.behavior.collaborations.MMessage activator)
          Returns true if the given message has the message activator somewhere as it's activator.
 boolean isAddingCollaborationAllowed(java.lang.Object context)
          Returns true if a collaboration may be added to the given context.
 void setActionAsAction(java.lang.Object message, java.lang.Object action)
          Couples a given action to the given messgae as being the action.
 void setActivator(ru.novosoft.uml.behavior.collaborations.MMessage mes, ru.novosoft.uml.behavior.collaborations.MMessage activator)
          Sets the activator of some given message mes.
 void setBase(ru.novosoft.uml.behavior.collaborations.MAssociationRole role, ru.novosoft.uml.foundation.core.MAssociation base)
          Sets the base of some associationrole, including the attached assocationendroles.
 void setBases(ru.novosoft.uml.behavior.collaborations.MClassifierRole role, java.util.Collection bases)
          Sets the bases of the given classifierrole to the given collection bases.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHelper

public static CollaborationsHelper getHelper()
Singleton instance access method.

getAllClassifierRoles

public java.util.Collection getAllClassifierRoles()
Returns all classifierroles found in the projectbrowser model
Returns:
Collection

getAllClassifierRoles

public java.util.Collection getAllClassifierRoles(ru.novosoft.uml.foundation.core.MNamespace ns)
Returns all classifierroles found in this namespace and in its children
Returns:
Collection

getAllPossibleAssociationRoles

public java.util.Collection getAllPossibleAssociationRoles(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
Returns all associations the bases of the classifierrole has, thereby forming the set of associationroles the classifierrole can use. UML Spec 1.3 section 2.10.3.3
Parameters:
role -  
Returns:
Collection

getClassifierRoles

public java.util.Collection getClassifierRoles(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
Returns all classifierroles associated via associationroles to some classifierrole role
Parameters:
role -  
Returns:
Collection

getAssocationRole

public ru.novosoft.uml.behavior.collaborations.MAssociationRole getAssocationRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole from,
                                                                                  ru.novosoft.uml.behavior.collaborations.MClassifierRole to)
Returns the first found associationrole between two classifierroles.
Parameters:
from -  
to -  
Returns:
MAssociationRole

getAllPossibleActivators

public java.util.Collection getAllPossibleActivators(ru.novosoft.uml.behavior.collaborations.MMessage mes)
Returns all possible activators for some message mes. The possible activators are all messages in the same interaction as the given message that are not part of the predecessors of the message and that are not equal to the given message.
Parameters:
mes -  
Returns:
Collection

hasAsActivator

public boolean hasAsActivator(ru.novosoft.uml.behavior.collaborations.MMessage message,
                              ru.novosoft.uml.behavior.collaborations.MMessage activator)
Returns true if the given message has the message activator somewhere as it's activator. This is defined as that the message activator can be the activator itself of the given message OR that the given activator can be the activator of the activator of the given message (recursive) OR that the given activator is part of the predecessors of the activator of the given message (recursive too).
Parameters:
message -  
activator -  
Returns:
boolean

setActivator

public void setActivator(ru.novosoft.uml.behavior.collaborations.MMessage mes,
                         ru.novosoft.uml.behavior.collaborations.MMessage activator)
Sets the activator of some given message mes. Checks the wellformednessrules as defined in the UML 1.3 spec in section 2.10.3.6, will throw an illegalargumentexception if the wellformednessrules are not met. Not only sets the activator for the given message mes but also for the predecessors of mes. This is done since it can not be the case that a list of messages (defined by the predecessor) has a different activator.
Parameters:
mes -  
activator -  

getAllPossiblePredecessors

public java.util.Collection getAllPossiblePredecessors(ru.novosoft.uml.behavior.collaborations.MMessage message)
Returns all possible predecessors for some message, taking into account the wellformednessrules as defined in section 2.10 of the UML spec.
Parameters:
message -  
Returns:
Collection

getAllPossibleBases

public java.util.Collection getAllPossibleBases(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
Returns all possible bases for some classifierrole taking into account the wellformednessrules as defined in section 2.10.3 of the UML 1.3 spec.
Parameters:
role -  
Returns:
Collection

addBase

public void addBase(ru.novosoft.uml.behavior.collaborations.MClassifierRole role,
                    ru.novosoft.uml.foundation.core.MClassifier base)
Adds a base to the given classifierrole. If the classifierrole does not have a name yet and there is only one base, the name of the classifierrole is set to the name of the given base according to the wellformednessrules of section 2.10.3 of the UML 1.3 spec.
Parameters:
role -  
base -  

setBases

public void setBases(ru.novosoft.uml.behavior.collaborations.MClassifierRole role,
                     java.util.Collection bases)
Sets the bases of the given classifierrole to the given collection bases.
Parameters:
role -  
bases -  

allAvailableFeatures

public java.util.Collection allAvailableFeatures(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
Returns all available features for a given classifierrole as defined in section 2.10.3.3 of the UML 1.3 spec. Does not use the standard getAvailableFeatures method on ClassifierRole since this is derived information.
Parameters:
role -  
Returns:
Collection

allAvailableContents

public java.util.Collection allAvailableContents(ru.novosoft.uml.behavior.collaborations.MClassifierRole role)
Returns all available contents for a given classifierrole as defined in section 2.10.3.3 of the UML 1.3 spec. Does not use the standard getAvailableContents method on ClassifierRole since this is derived information.
Parameters:
role -  
Returns:
Collection

getAllPossibleBases

public java.util.Collection getAllPossibleBases(ru.novosoft.uml.behavior.collaborations.MAssociationRole role)
Returns all possible bases for some associationrole taking into account the wellformednessrules as defined in section 2.10.3 of the UML 1.3 spec.
Parameters:
role -  
Returns:
Collection

setBase

public void setBase(ru.novosoft.uml.behavior.collaborations.MAssociationRole role,
                    ru.novosoft.uml.foundation.core.MAssociation base)
Sets the base of some associationrole, including the attached assocationendroles. Checks for wellformedness first.
Parameters:
role -  
base -  

setActionAsAction

public void setActionAsAction(java.lang.Object message,
                              java.lang.Object action)
Couples a given action to the given messgae as being the action. To decouple ArgoUML as much as possible from the NSUML model, the parameters of the method are of type Object.
Parameters:
state -  
action -  

isAddingCollaborationAllowed

public boolean isAddingCollaborationAllowed(java.lang.Object context)
Returns true if a collaboration may be added to the given context. To decouple ArgoUML as much as possible from the NSUML model, the parameter of the method is of type Object.
Parameters:
context -  
Returns:
boolean


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook