• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

UMLRole Class Reference

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

#include <umlrole.h>

Inheritance diagram for UMLRole:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 UMLRole (UMLAssociation *parent, UMLObject *parentUMLObject, Uml::Role_Type role)
virtual ~UMLRole ()
UMLObject * clone () const
Uml::Changeability_Type getChangeability () const
QString getMultiplicity () const
UMLObject * getObject ()
UMLAssociation * getParentAssociation ()
Uml::Role_Type getRole ()
bool operator== (const UMLRole &rhs)
void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
void setChangeability (Uml::Changeability_Type value)
void setMultiplicity (const QString &multi)
void setObject (UMLObject *obj)

Protected Member Functions

bool load (QDomElement &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 25 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 (association) of this UMLRole.
parentUMLObject The Parent UML Object of this UMLRole
role The Uml::Role_Type of this UMLRole

Definition at line 25 of file umlrole.cpp.

UMLRole::~UMLRole (  )  [virtual]

Standard deconstructor.

Definition at line 31 of file umlrole.cpp.


Member Function Documentation

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

Implements UMLObject.

Definition at line 64 of file umlrole.h.

Uml::Changeability_Type UMLRole::getChangeability (  )  const

Returns the Changeablity of the role.

Returns:
Changeability_Type of role.

Definition at line 66 of file umlrole.cpp.

QString UMLRole::getMultiplicity (  )  const

Returns the multiplicity assigned to the role.

Returns:
The multiplicity assigned to the role.

Definition at line 76 of file umlrole.cpp.

UMLObject * UMLRole::getObject (  ) 

Returns the UMLObject assigned to the role.

Returns:
Pointer to the UMLObject in role.

Definition at line 56 of file umlrole.cpp.

UMLAssociation * UMLRole::getParentAssociation (  ) 

Definition at line 47 of file umlrole.cpp.

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 131 of file umlrole.cpp.

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

Loads the <UML:AssociationEnd> XMI element.

Auxiliary to UMLObject::loadFromXMI.

There are different ways in which the multiplicity might be given:

  • direct value in the <AssociationEnd.multiplicity> tag,
  • attributes "lower" and "upper" of a subordinate <MultiplicityRange>,
  • direct value in subordinate <MultiplicityRange.lower> and <MultiplicityRange.upper> tags

Reimplemented from UMLObject.

Definition at line 213 of file umlrole.cpp.

bool UMLRole::operator== ( const UMLRole &  rhs  ) 

Overloaded '==' operator.

Reimplemented from UMLObject.

Definition at line 35 of file umlrole.cpp.

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

Creates the <UML:AssociationEnd> XMI element.

Implements UMLObject.

Definition at line 154 of file umlrole.cpp.

void UMLRole::setChangeability ( Uml::Changeability_Type  value  ) 

Sets the changeability of the role.

Parameters:
value Changeability_Type of role changeability.

Definition at line 108 of file umlrole.cpp.

void UMLRole::setMultiplicity ( const QString &  multi  ) 

Sets the multiplicity of the role.

Parameters:
multi The multiplicity of role.

Definition at line 119 of file umlrole.cpp.

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 86 of file umlrole.cpp.


The documentation for this class was generated from the following files:
  • umlrole.h
  • umlrole.cpp

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal