org.argouml.model
Interface CollaborationsHelper

All Known Implementing Classes:
AbstractCollaborationsHelperDecorator

public interface CollaborationsHelper

The interface for the helper to Collaborations.

Created from the old CollaborationsHelper.


Method Summary
 void addBase(java.lang.Object classifierRole, java.lang.Object baseClassifier)
          Adds a base to the given classifierrole.
 void addConstrainingElement(java.lang.Object handle, java.lang.Object constraint)
          Add a constraining element.
 void addInstance(java.lang.Object classifierRole, java.lang.Object instance)
          Adds an instance to a classifier role.
 void addMessage(java.lang.Object handle, java.lang.Object message)
          Add a message to an interaction or association role.
 void addPredecessor(java.lang.Object handle, java.lang.Object predecessor)
          Adds a predecessor to a message.
 void addSuccessor(java.lang.Object predecessor, java.lang.Object message)
          Add Message to a predecessor Message.
 java.util.Collection allAvailableContents(java.lang.Object classifierRole)
          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 classifierRole)
          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(java.lang.Object namespace)
          Returns all classifierroles found in this namespace and in its children.
 java.util.Collection getAllPossibleActivators(java.lang.Object message)
          Returns all possible activators for some message mes.
 java.util.Collection getAllPossibleAssociationRoles(java.lang.Object classifierRole)
          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)
          Returns all possible bases for the given element (a ClassifierRole or AssociationRole).
 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 getAssociationRole(java.lang.Object fromRole, java.lang.Object toRole)
          Returns the first found associationrole between two classifierroles.
 java.util.Collection getClassifierRoles(java.lang.Object classifierRole)
          Returns all classifierroles associated via associationroles to some classifierrole role.
 boolean hasAsActivator(java.lang.Object message, java.lang.Object 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 removeBase(java.lang.Object classifierRole, java.lang.Object baseClassifier)
          This method removes a classifier from a classifier role.
 void removeConstrainingElement(java.lang.Object handle, java.lang.Object constraint)
          Remove a constraining element.
 void removeInteraction(java.lang.Object collab, java.lang.Object interaction)
          Remove an Interaction from a Collaboration.
 void removeMessage(java.lang.Object handle, java.lang.Object message)
          Removes a message from the interaction or association role.
 void removePredecessor(java.lang.Object handle, java.lang.Object message)
          Removes a predecessor message.
 void removeSuccessor(java.lang.Object handle, java.lang.Object message)
          Removes a successor message.
 void setAction(java.lang.Object handle, java.lang.Object action)
          Sets the action to a message.
 void setActivator(java.lang.Object message, java.lang.Object activator)
          Sets the activator of some given message mes.
 void setBase(java.lang.Object classifierRole, java.lang.Object baseClassifier)
          Sets the base checking for wellformedness according to 2.10.3 in the UML 1.3 specification.
 void setBases(java.lang.Object classifierRole, java.util.Collection bases)
          Sets the bases of the given classifierrole to the given collection bases.
 void setContext(java.lang.Object interaction, java.lang.Object context)
          Set the context of an interaction.
 void setPredecessors(java.lang.Object handle, java.util.Collection predecessors)
          Set the collection of predecessor messages.
 void setRepresentedClassifier(java.lang.Object handle, java.lang.Object classifier)
          Sets the represented classifier of some collaboration.
 void setRepresentedOperation(java.lang.Object handle, java.lang.Object operation)
          Sets the represented operation of some collaboration.
 void setSender(java.lang.Object handle, java.lang.Object sender)
          Sets the sender of some model element.
 void setSuccessors(java.lang.Object handle, java.util.Collection messages)
          Set the successors of a message.
 

Method Detail

getAllClassifierRoles

java.util.Collection getAllClassifierRoles(java.lang.Object namespace)
Returns all classifierroles found in this namespace and in its children.

Parameters:
namespace - the namespace
Returns:
Collection collection of all classifierroles

getAllPossibleAssociationRoles

java.util.Collection getAllPossibleAssociationRoles(java.lang.Object classifierRole)
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:
classifierRole - the classifierrole
Returns:
Collection the set of associationroles the classifierrole can use

getClassifierRoles

java.util.Collection getClassifierRoles(java.lang.Object classifierRole)
Returns all classifierroles associated via associationroles to some classifierrole role.

Parameters:
classifierRole - the classifierrole
Returns:
Collection all classifierroles associated via associationroles to the given classifierrole role

getAssociationRole

java.lang.Object getAssociationRole(java.lang.Object fromRole,
                                    java.lang.Object toRole)
Returns the first found associationrole between two classifierroles.

Parameters:
fromRole - the first classifierrole
toRole - the second classifierrole
Returns:
MAssociationRole the association between them, or null if none

getAllPossibleActivators

java.util.Collection getAllPossibleActivators(java.lang.Object message)
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:
message - the message
Returns:
Collection all possible activators for the given message

hasAsActivator

boolean hasAsActivator(java.lang.Object message,
                       java.lang.Object 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 - the given message
activator - the given activator (a message).
Returns:
boolean true if the given message has the message activator somewhere as it's activator

setActivator

void setActivator(java.lang.Object message,
                  java.lang.Object 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:
message - the given message
activator - the given activator or null.

getAllPossiblePredecessors

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 - the given message
Returns:
Collection all possible predecessors

addBase

void addBase(java.lang.Object classifierRole,
             java.lang.Object baseClassifier)
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:
classifierRole - the given classifierrole
baseClassifier - the base to be added

setBases

void setBases(java.lang.Object classifierRole,
              java.util.Collection bases)
Sets the bases of the given classifierrole to the given collection bases.

Parameters:
classifierRole - the given classifierrole
bases - the given collection of bases

allAvailableFeatures

java.util.Collection allAvailableFeatures(java.lang.Object classifierRole)
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:
classifierRole - the given classifierrole
Returns:
Collection all available features

allAvailableContents

java.util.Collection allAvailableContents(java.lang.Object classifierRole)
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:
classifierRole - the given classifierrole
Returns:
Collection all available contents

getAllPossibleBases

java.util.Collection getAllPossibleBases(java.lang.Object role)
Returns all possible bases for the given element (a ClassifierRole or AssociationRole).

Beware: this function does not return the current base! Which is by design; there are easier ways to retrieve the actual base.

Parameters:
role - the given classifierrole or associationrole
Returns:
all available bases

setBase

void setBase(java.lang.Object classifierRole,
             java.lang.Object baseClassifier)
Sets the base checking for wellformedness according to 2.10.3 in the UML 1.3 specification.

Either the role can be an AssociationRole in which case the given base must be an Association. Or the role can be an AssocationEndRole in which case the given base must be an AssociationEnd.

To set the base(s) of a ClassifierRole use setBases(Object, Collection).

Parameters:
classifierRole - The given role.
baseClassifier - The base to set (or null to clear).

isAddingCollaborationAllowed

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 model implementation, the parameter of the method is of type Object.

Parameters:
context - the given context
Returns:
boolean true if a collaboration may be added

removeBase

void removeBase(java.lang.Object classifierRole,
                java.lang.Object baseClassifier)
This method removes a classifier from a classifier role.

Parameters:
classifierRole - is the classifier role
baseClassifier - is the classifier

removeConstrainingElement

void removeConstrainingElement(java.lang.Object handle,
                               java.lang.Object constraint)
Remove a constraining element.

Parameters:
handle - The collaboration to remove a constraint to.
constraint - The constraint to remove.

removeMessage

void removeMessage(java.lang.Object handle,
                   java.lang.Object message)
Removes a message from the interaction or association role.

Parameters:
handle - The interaction or association role to remove the message from.
message - The message to remove.

removeSuccessor

void removeSuccessor(java.lang.Object handle,
                     java.lang.Object message)
Removes a successor message.

Parameters:
handle - the Message that needs to loose a successor
message - the Message that is removed

removePredecessor

void removePredecessor(java.lang.Object handle,
                       java.lang.Object message)
Removes a predecessor message.

Parameters:
handle - the Message that needs to loose a predecessor
message - the Message that is removed

addConstrainingElement

void addConstrainingElement(java.lang.Object handle,
                            java.lang.Object constraint)
Add a constraining element.

Parameters:
handle - The collaboration to add a constraint to.
constraint - The constraint to add.

addInstance

void addInstance(java.lang.Object classifierRole,
                 java.lang.Object instance)
Adds an instance to a classifier role.

Parameters:
classifierRole - is the classifier role
instance - is the instance to add

addMessage

void addMessage(java.lang.Object handle,
                java.lang.Object message)
Add a message to an interaction or association role.

Parameters:
handle - The interaction or association role.
message - The message.

addSuccessor

void addSuccessor(java.lang.Object predecessor,
                  java.lang.Object message)
Add Message to a predecessor Message.

Parameters:
predecessor - predecessor Message
message - Message to be added

addPredecessor

void addPredecessor(java.lang.Object handle,
                    java.lang.Object predecessor)
Adds a predecessor to a message.

Parameters:
handle - the message
predecessor - is the predecessor

setAction

void setAction(java.lang.Object handle,
               java.lang.Object action)
Sets the action to a message.

Parameters:
handle - is the message
action - is the action

setContext

void setContext(java.lang.Object interaction,
                java.lang.Object context)
Set the context of an interaction.

Parameters:
interaction - The interaction.
context - The collaboration to set as the context.

setSuccessors

void setSuccessors(java.lang.Object handle,
                   java.util.Collection messages)
Set the successors of a message.

Parameters:
handle - Message
messages - Collection of successor messages

setPredecessors

void setPredecessors(java.lang.Object handle,
                     java.util.Collection predecessors)
Set the collection of predecessor messages.

Parameters:
handle - Message
predecessors - Collection of Messages

setRepresentedClassifier

void setRepresentedClassifier(java.lang.Object handle,
                              java.lang.Object classifier)
Sets the represented classifier of some collaboration.

Parameters:
handle - the collaboration
classifier - is the classifier or null

setRepresentedOperation

void setRepresentedOperation(java.lang.Object handle,
                             java.lang.Object operation)
Sets the represented operation of some collaboration.

Parameters:
handle - the collaboration
operation - is the operation or null

setSender

void setSender(java.lang.Object handle,
               java.lang.Object sender)
Sets the sender of some model element.

Parameters:
handle - model element
sender - the sender

removeInteraction

void removeInteraction(java.lang.Object collab,
                       java.lang.Object interaction)
Remove an Interaction from a Collaboration.

Parameters:
collab - The collaboration.
interaction - The interaction.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook