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

java.lang.Object
  extended byorg.argouml.model.uml.AbstractUmlModelFactory
      extended byorg.argouml.model.uml.behavioralelements.collaborations.CollaborationsFactory

public class CollaborationsFactory
extends AbstractUmlModelFactory

Factory to create UML classes for the UML BehaviorialElements::Collaborations package.

Since:
ARGO0.11.2

Field Summary
private static CollaborationsFactory SINGLETON
          Singleton instance.
 
Fields inherited from class org.argouml.model.uml.AbstractUmlModelFactory
 
Constructor Summary
private CollaborationsFactory()
          Don't allow instantiation
 
Method Summary
 ru.novosoft.uml.behavior.collaborations.MMessage buildActivator(ru.novosoft.uml.behavior.collaborations.MMessage owner, ru.novosoft.uml.behavior.collaborations.MInteraction interaction)
          Builds an activator for some message
 ru.novosoft.uml.behavior.collaborations.MAssociationEndRole buildAssociationEndRole(java.lang.Object atype)
          Builds an associationendrole based on some classifierrole
 ru.novosoft.uml.behavior.collaborations.MAssociationRole buildAssociationRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole from, ru.novosoft.uml.foundation.data_types.MAggregationKind agg1, ru.novosoft.uml.behavior.collaborations.MClassifierRole to, ru.novosoft.uml.foundation.data_types.MAggregationKind agg2, java.lang.Boolean unidirectional)
          Builds a binary associationrole on basis of two classifierroles, navigation and aggregation
 java.lang.Object buildAssociationRole(java.lang.Object link)
          Builds an associationrole based on a given link.
 ru.novosoft.uml.behavior.collaborations.MAssociationRole buildAssociationRole(java.lang.Object from, java.lang.Object to)
          Builds a binary associationrole on basis of two classifierroles
 java.lang.Object buildClassifierRole(java.lang.Object collaboration)
          Creates a classifierrole and adds it to the given collaboration
 ru.novosoft.uml.behavior.collaborations.MCollaboration buildCollaboration(java.lang.Object handle)
          Builds a default collaboration not attached to a classifier
 java.lang.Object buildCollaboration(java.lang.Object namespace, java.lang.Object representedElement)
          Builds a collaboration that is owned by a certain namespace and represents the given represented element.
 ru.novosoft.uml.behavior.collaborations.MInteraction buildInteraction(java.lang.Object handle)
          Builds an interaction belonging to some collaboration
 java.lang.Object buildMessage(java.lang.Object acollab, java.lang.Object arole)
          Builds a message within some collaboration or interaction.
private  java.lang.Object buildMessageCollab(java.lang.Object acollab, java.lang.Object arole)
           
private  ru.novosoft.uml.behavior.collaborations.MMessage buildMessageInteraction(ru.novosoft.uml.behavior.collaborations.MInteraction inter, ru.novosoft.uml.behavior.collaborations.MAssociationRole role)
          Builds a message within some interaction related to some assocationrole.
 ru.novosoft.uml.behavior.collaborations.MAssociationEndRole createAssociationEndRole()
          Create an empty but initialized instance of a UML AssociationEndRole.
 ru.novosoft.uml.behavior.collaborations.MAssociationRole createAssociationRole()
          Create an empty but initialized instance of a UML AssociationRole.
 ru.novosoft.uml.behavior.collaborations.MClassifierRole createClassifierRole()
          Create an empty but initialized instance of a UML ClassifierRole.
 ru.novosoft.uml.behavior.collaborations.MCollaboration createCollaboration()
          Create an empty but initialized instance of a UML Collaboration.
 ru.novosoft.uml.behavior.collaborations.MInteraction createInteraction()
          Create an empty but initialized instance of a UML Interaction.
 ru.novosoft.uml.behavior.collaborations.MMessage createMessage()
          Create an empty but initialized instance of a UML Message.
 void deleteAssociationEndRole(ru.novosoft.uml.behavior.collaborations.MAssociationEndRole elem)
           
 void deleteAssociationRole(ru.novosoft.uml.behavior.collaborations.MAssociationRole elem)
           
 void deleteClassifierRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole elem)
           
 void deleteCollaboration(ru.novosoft.uml.behavior.collaborations.MCollaboration elem)
           
 void deleteInteraction(ru.novosoft.uml.behavior.collaborations.MInteraction elem)
           
 void deleteMessage(ru.novosoft.uml.behavior.collaborations.MMessage elem)
           
private  ru.novosoft.uml.behavior.collaborations.MMessage findEnd(ru.novosoft.uml.behavior.collaborations.MMessage m)
          Walks the tree of successors to m rooted until a leaf is found.
static CollaborationsFactory getFactory()
          Singleton instance access method.
private  ru.novosoft.uml.behavior.collaborations.MMessage lastMessage(java.util.Collection c, ru.novosoft.uml.behavior.collaborations.MMessage m)
          Finds the last message in the collection not equal to null and not equal to m.
 
Methods inherited from class org.argouml.model.uml.AbstractUmlModelFactory
addListenersToModelElement, initialize, isGuiEnabled, setGuiEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON

private static CollaborationsFactory SINGLETON
Singleton instance.

Constructor Detail

CollaborationsFactory

private CollaborationsFactory()
Don't allow instantiation

Method Detail

getFactory

public static CollaborationsFactory getFactory()
Singleton instance access method.


createAssociationEndRole

public ru.novosoft.uml.behavior.collaborations.MAssociationEndRole createAssociationEndRole()
Create an empty but initialized instance of a UML AssociationEndRole.

Returns:
an initialized UML AssociationEndRole instance.

createAssociationRole

public ru.novosoft.uml.behavior.collaborations.MAssociationRole createAssociationRole()
Create an empty but initialized instance of a UML AssociationRole.

Returns:
an initialized UML AssociationRole instance.

createClassifierRole

public ru.novosoft.uml.behavior.collaborations.MClassifierRole createClassifierRole()
Create an empty but initialized instance of a UML ClassifierRole.

Returns:
an initialized UML ClassifierRole instance.

createCollaboration

public ru.novosoft.uml.behavior.collaborations.MCollaboration createCollaboration()
Create an empty but initialized instance of a UML Collaboration.

Returns:
an initialized UML Collaboration instance.

createInteraction

public ru.novosoft.uml.behavior.collaborations.MInteraction createInteraction()
Create an empty but initialized instance of a UML Interaction.

Returns:
an initialized UML Interaction instance.

createMessage

public ru.novosoft.uml.behavior.collaborations.MMessage createMessage()
Create an empty but initialized instance of a UML Message.

Returns:
an initialized UML Message instance.

buildClassifierRole

public java.lang.Object buildClassifierRole(java.lang.Object collaboration)
Creates a classifierrole and adds it to the given collaboration

Parameters:
collaboration -
Returns:
the created classifier role

buildCollaboration

public ru.novosoft.uml.behavior.collaborations.MCollaboration buildCollaboration(java.lang.Object handle)
Builds a default collaboration not attached to a classifier


buildCollaboration

public java.lang.Object buildCollaboration(java.lang.Object namespace,
                                           java.lang.Object representedElement)
Builds a collaboration that is owned by a certain namespace and represents the given represented element.

Parameters:
namespace -
representedElement -
Returns:
the created collaboration

buildInteraction

public ru.novosoft.uml.behavior.collaborations.MInteraction buildInteraction(java.lang.Object handle)
Builds an interaction belonging to some collaboration


buildAssociationEndRole

public ru.novosoft.uml.behavior.collaborations.MAssociationEndRole buildAssociationEndRole(java.lang.Object atype)
Builds an associationendrole based on some classifierrole


buildAssociationRole

public ru.novosoft.uml.behavior.collaborations.MAssociationRole buildAssociationRole(java.lang.Object from,
                                                                                     java.lang.Object to)
Builds a binary associationrole on basis of two classifierroles


buildAssociationRole

public ru.novosoft.uml.behavior.collaborations.MAssociationRole buildAssociationRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole from,
                                                                                     ru.novosoft.uml.foundation.data_types.MAggregationKind agg1,
                                                                                     ru.novosoft.uml.behavior.collaborations.MClassifierRole to,
                                                                                     ru.novosoft.uml.foundation.data_types.MAggregationKind agg2,
                                                                                     java.lang.Boolean unidirectional)
Builds a binary associationrole on basis of two classifierroles, navigation and aggregation


buildAssociationRole

public java.lang.Object buildAssociationRole(java.lang.Object link)
Builds an associationrole based on a given link. The link must have a source and a destination instance that both have a classifierrole as classifier. The classifierroles must have the same collaboration as owner. This collaboration will be the new owner of the associationrole.

Parameters:
link -
Returns:
the newly created association role (an Object)

buildMessageInteraction

private ru.novosoft.uml.behavior.collaborations.MMessage buildMessageInteraction(ru.novosoft.uml.behavior.collaborations.MInteraction inter,
                                                                                 ru.novosoft.uml.behavior.collaborations.MAssociationRole role)
Builds a message within some interaction related to some assocationrole. The message is added as the last in the interaction sequence. Furthermore, the message is added as the last to the list of messages allready attached to the role. Effectively, the allready attached messages become predecessors of this message.


lastMessage

private ru.novosoft.uml.behavior.collaborations.MMessage lastMessage(java.util.Collection c,
                                                                     ru.novosoft.uml.behavior.collaborations.MMessage m)
Finds the last message in the collection not equal to null and not equal to m.

Parameters:
c - A collection containing exclusively MMessages.
m - A MMessage.
Returns:
The last message in the collection, or null.

findEnd

private ru.novosoft.uml.behavior.collaborations.MMessage findEnd(ru.novosoft.uml.behavior.collaborations.MMessage m)
Walks the tree of successors to m rooted until a leaf is found. The leaf is the returned. If m is itself a leaf, then m is returned.

Parameters:
m - A MMessage.
Returns:
The last message in one branch of the tree rooted at m.

buildMessage

public java.lang.Object buildMessage(java.lang.Object acollab,
                                     java.lang.Object arole)
Builds a message within some collaboration or interaction.


buildMessageCollab

private java.lang.Object buildMessageCollab(java.lang.Object acollab,
                                            java.lang.Object arole)

buildActivator

public ru.novosoft.uml.behavior.collaborations.MMessage buildActivator(ru.novosoft.uml.behavior.collaborations.MMessage owner,
                                                                       ru.novosoft.uml.behavior.collaborations.MInteraction interaction)
Builds an activator for some message


deleteAssociationEndRole

public void deleteAssociationEndRole(ru.novosoft.uml.behavior.collaborations.MAssociationEndRole elem)

deleteAssociationRole

public void deleteAssociationRole(ru.novosoft.uml.behavior.collaborations.MAssociationRole elem)

deleteClassifierRole

public void deleteClassifierRole(ru.novosoft.uml.behavior.collaborations.MClassifierRole elem)

deleteCollaboration

public void deleteCollaboration(ru.novosoft.uml.behavior.collaborations.MCollaboration elem)

deleteInteraction

public void deleteInteraction(ru.novosoft.uml.behavior.collaborations.MInteraction elem)

deleteMessage

public void deleteMessage(ru.novosoft.uml.behavior.collaborations.MMessage elem)


ArgoUML © 1996-2004 (20040316)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook