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

Field Summary
private static CollaborationsHelper SINGLETON
          Singleton instance.
 
Constructor Summary
private CollaborationsHelper()
          Don't allow instantiation.
 
Method Summary
 void addBase(java.lang.Object arole, java.lang.Object abase)
          Adds a base to the given classifierrole.
 java.util.Collection allAvailableContents(java.lang.Object arole)
          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(java.lang.Object arole)
          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(MNamespace ns)
          Returns all classifierroles found in this namespace and in its children.
 java.util.Collection getAllPossibleActivators(java.lang.Object ames)
          Returns all possible activators for some message mes.
 java.util.Collection getAllPossibleAssociationRoles(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(java.lang.Object role)
           
 java.util.Collection getAllPossiblePredecessors(java.lang.Object amessage)
          Returns all possible predecessors for some message, taking into account the wellformednessrules as defined in section 2.10 of the UML spec.
 java.lang.Object getAssocationRole(java.lang.Object afrom, java.lang.Object ato)
          Returns the first found associationrole between two classifierroles.
 java.util.Collection getClassifierRoles(MClassifierRole role)
          Returns all classifierroles associated via associationroles to some classifierrole role.
static CollaborationsHelper getHelper()
          Singleton instance access method.
 boolean hasAsActivator(MMessage message, 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 setActivator(java.lang.Object ames, java.lang.Object anactivator)
          Sets the activator of some given message mes.
 void setBase(java.lang.Object arole, java.lang.Object abase)
          Sets the base of some associationrole, including the attached assocationendroles.
 void setBases(java.lang.Object 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
 

Field Detail

SINGLETON

private static CollaborationsHelper SINGLETON
Singleton instance.

Constructor Detail

CollaborationsHelper

private CollaborationsHelper()
Don't allow instantiation.

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(MNamespace ns)
Returns all classifierroles found in this namespace and in its children.

Returns:
Collection

getAllPossibleAssociationRoles

public java.util.Collection getAllPossibleAssociationRoles(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(MClassifierRole role)
Returns all classifierroles associated via associationroles to some classifierrole role.

Parameters:
role -
Returns:
Collection

getAssocationRole

public java.lang.Object getAssocationRole(java.lang.Object afrom,
                                          java.lang.Object ato)
Returns the first found associationrole between two classifierroles.

Parameters:
afrom -
ato -
Returns:
MAssociationRole

getAllPossibleActivators

public java.util.Collection getAllPossibleActivators(java.lang.Object ames)
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:
ames -
Returns:
Collection

hasAsActivator

public boolean hasAsActivator(MMessage message,
                              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(java.lang.Object ames,
                         java.lang.Object anactivator)
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:
ames -
anactivator -

getAllPossiblePredecessors

public java.util.Collection getAllPossiblePredecessors(java.lang.Object amessage)
Returns all possible predecessors for some message, taking into account the wellformednessrules as defined in section 2.10 of the UML spec.

Parameters:
amessage -
Returns:
Collection

addBase

public void addBase(java.lang.Object arole,
                    java.lang.Object abase)
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:
arole -
abase -

setBases

public void setBases(java.lang.Object 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(java.lang.Object arole)
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:
arole -
Returns:
Collection

allAvailableContents

public java.util.Collection allAvailableContents(java.lang.Object arole)
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:
arole -
Returns:
Collection

getAllPossibleBases

public java.util.Collection getAllPossibleBases(java.lang.Object role)

setBase

public void setBase(java.lang.Object arole,
                    java.lang.Object abase)
Sets the base of some associationrole, including the attached assocationendroles. Checks for wellformedness first.

Parameters:
arole -
abase -

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 © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook