umbrello API Documentation

UMLRole Class Reference

This class contains the non-graphic representation of an association role. More...

#include <umlrole.h>

Inheritance diagram for UMLRole:

UMLObject List of all members.

Public Member Functions

 UMLRole (UMLAssociation *parent, UMLObject *parentUMLObject, Uml::Role_Type role)
 Sets up an association.
bool operator== (UMLRole &rhs)
 Overloaded '==' operator.
virtual ~UMLRole ()
 Standard deconstructor.
UMLObjectgetObject ()
 Returns the UMLObject assigned to the role.
Uml::Changeability_Type getChangeability () const
 Returns the Changeablity of the role.
QString getMultiplicity () const
 Returns the multiplicity assigned to the role.
void setObject (UMLObject *obj)
 Sets the UMLObject playing the role in the association.
void setChangeability (Uml::Changeability_Type value)
 Sets the changeability of the role.
void setMultiplicity (const QString &multi)
 Sets the multiplicity of the role.
UMLAssociationgetParentAssociation ()
Uml::Role_Type getRole ()
 get the 'id' of the role (NOT the parent object).
UMLObjectclone () const
 Make a clone of this object.
void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
 Creates the <UML:AssociationEnd> XMI element.

Protected Member Functions

bool load (QDomElement &element)
 Loads the <UML:AssociationEnd> XMI element.

Detailed Description

This class contains the non-graphic representation of an association role.

Author:
Brian Thomas <brian.thomas@gsfc.nasa.gov>
See also:
UMLObject

Definition at line 26 of file umlrole.h.


Constructor & Destructor Documentation

UMLRole::UMLRole UMLAssociation parent,
UMLObject parentUMLObject,
Uml::Role_Type  role
 

Sets up an association.

Parameters:
parent The parent of this UMLRole.

Definition at line 26 of file umlrole.cpp.

References UMLObject::init().

UMLRole::~UMLRole  )  [virtual]
 

Standard deconstructor.

Definition at line 32 of file umlrole.cpp.


Member Function Documentation

bool UMLRole::operator== UMLRole rhs  ) 
 

Overloaded '==' operator.

Definition at line 34 of file umlrole.cpp.

UMLObject * UMLRole::getObject  ) 
 

Returns the UMLObject assigned to the role.

Returns:
Pointer to the UMLObject in role.

Definition at line 49 of file umlrole.cpp.

Referenced by UMLAssociation::getObject(), UMLAssociation::getObjectId(), CodeClassField::getTypeName(), UMLAssociation::resolveRef(), and UMLAssociation::toString().

Uml::Changeability_Type UMLRole::getChangeability  )  const
 

Returns the Changeablity of the role.

Returns:
Changeability_Type of role.

Definition at line 53 of file umlrole.cpp.

Referenced by UMLAssociation::getChangeability().

QString UMLRole::getMultiplicity  )  const
 

Returns the multiplicity assigned to the role.

Returns:
The multiplicity assigned to the role.

Definition at line 57 of file umlrole.cpp.

Referenced by CodeClassField::fieldIsSingleValue(), UMLAssociation::getMulti(), ClassifierCodeDocument::hasObjectVectorClassFields(), CodeClassField::maximumListOccurances(), and CodeClassField::minimumListOccurances().

void UMLRole::setObject UMLObject obj  ) 
 

Sets the UMLObject playing the role in the association.

Parameters:
obj Pointer to the UMLObject of role.

Definition at line 61 of file umlrole.cpp.

References UMLObject::emitModified().

Referenced by UMLAssociation::load(), and UMLAssociation::setObject().

void UMLRole::setChangeability Uml::Changeability_Type  value  ) 
 

Sets the changeability of the role.

Parameters:
value Changeability_Type of role changeability.

Definition at line 77 of file umlrole.cpp.

References UMLObject::emitModified().

Referenced by UMLAssociation::setChangeability(), and UMLRoleProperties::updateObject().

void UMLRole::setMultiplicity const QString &  multi  ) 
 

Sets the multiplicity of the role.

Parameters:
multi The multiplicity of role.

Definition at line 82 of file umlrole.cpp.

References UMLObject::emitModified().

Referenced by UMLAssociation::setMulti(), Import_Rose::umbrellify(), and UMLRoleProperties::updateObject().

Uml::Role_Type UMLRole::getRole  ) 
 

get the 'id' of the role (NOT the parent object).

This could be either Uml::A or Uml::B. Yes, it would be better if we could get along without this, but we need it to distinguish saved umlrole objects in the XMI for 'self' associations where both roles will point to the same underlying UMLObject.

Definition at line 87 of file umlrole.cpp.

Referenced by ClassifierCodeDocument::findCodeClassFieldFromParentID(), CodeClassField::findMethodByType(), OwnedHierarchicalCodeBlock::setAttributesOnNode(), OwnedCodeBlock::setAttributesOnNode(), and CodeParameter::setAttributesOnNode().

UMLObject* UMLRole::clone  )  const [inline, virtual]
 

Make a clone of this object.

Not yet implemented.

Implements UMLObject.

Definition at line 101 of file umlrole.h.

void UMLRole::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[virtual]
 

Creates the <UML:AssociationEnd> XMI element.

Implements UMLObject.

Definition at line 104 of file umlrole.cpp.

References UMLAssociation::getAssocType(), UMLObject::getID(), UMLObject::getVisibility(), and UMLObject::save().

Referenced by UMLAssociation::saveToXMI().

bool UMLRole::load QDomElement &  element  )  [protected, virtual]
 

Loads the <UML:AssociationEnd> XMI element.

Auxiliary to UMLObject::loadFromXMI.

Reimplemented from UMLObject.

Definition at line 159 of file umlrole.cpp.

References UMLDoc::findObjectById(), UMLApp::getDocument(), UMLAssociation::getOldLoadMode(), UMLAssociation::setAssocType(), UMLAssociation::setOldLoadMode(), and Uml::tagEq().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:08 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003