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

umbrello/umbrello

UMLEntity Class Reference

#include <entity.h>

Inheritance diagram for UMLEntity:

Inheritance graph
[legend]

List of all members.


Detailed Description

This class contains the non-graphical information required for a UML Entity.

This class inherits from UMLClassifier which contains most of the information.

Non-graphical Information for an Entity.

Author:
Jonathan Riddell Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 35 of file entity.h.


Signals

void entityAttributeAdded (UMLClassifierListItem *)
void entityAttributeRemoved (UMLClassifierListItem *)
void entityConstraintAdded (UMLClassifierListItem *)
void entityConstraintRemoved (UMLClassifierListItem *)

Public Member Functions

 UMLEntity (const QString &name=QString(), Uml::IDType id=Uml::id_None)
virtual ~UMLEntity ()
bool operator== (const UMLEntity &rhs)
virtual void copyInto (UMLObject *lhs) const
virtual UMLObject * clone () const
UMLAttribute * createAttribute (const QString &name=QString(), UMLObject *type=0)
UMLUniqueConstraint * createUniqueConstraint (const QString &name=QString())
UMLForeignKeyConstraint * createForeignKeyConstraint (const QString &name=QString())
UMLCheckConstraint * createCheckConstraint (const QString &name=QString())
UMLObject * addEntityAttribute (const QString &name, Uml::IDType id=Uml::id_None)
bool addEntityAttribute (UMLEntityAttribute *att, IDChangeLog *Log=0)
bool addEntityAttribute (UMLEntityAttribute *att, int position)
int removeEntityAttribute (UMLClassifierListItem *a)
void signalEntityAttributeRemoved (UMLClassifierListItem *eattr)
int entityAttributes ()
bool setAsPrimaryKey (UMLUniqueConstraint *uconstr)
void unsetPrimaryKey ()
bool hasPrimaryKey () const
bool isPrimaryKey (UMLUniqueConstraint *uConstr) const
bool addConstraint (UMLEntityConstraint *constr)
bool removeConstraint (UMLEntityConstraint *constr)
virtual bool resolveRef ()
virtual void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
UMLClassifierListItemList getFilteredList (Uml::Object_Type ot) const
UMLEntityAttributeList getEntityAttributes () const

Protected Member Functions

bool load (QDomElement &element)

Constructor & Destructor Documentation

UMLEntity::UMLEntity ( const QString &  name = QString(),
Uml::IDType  id = Uml::id_None 
) [explicit]

Sets up an entity.

Parameters:
name The name of the Entity.
id The unique id of the Entity.

Definition at line 34 of file entity.cpp.

UMLEntity::~UMLEntity (  )  [virtual]

Standard deconstructor.

Definition at line 38 of file entity.cpp.


Member Function Documentation

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

Overloaded '==' operator.

Definition at line 42 of file entity.cpp.

void UMLEntity::copyInto ( UMLObject *  lhs  )  const [virtual]

Copy the internal presentation of this object into the new object.

Reimplemented from UMLClassifier.

Definition at line 46 of file entity.cpp.

UMLObject * UMLEntity::clone (  )  const [virtual]

Make a clone of this object.

Reimplemented from UMLClassifier.

Definition at line 57 of file entity.cpp.

UMLAttribute * UMLEntity::createAttribute ( const QString &  name = QString(),
UMLObject *  type = 0 
)

Creates an entity attribute for the parent concept.

Reimplementation of method from UMLClassifier.

Parameters:
name An optional name, used by when creating through UMLListView
type An optional type, used by when creating through UMLListView
Returns:
The UMLEntityAttribute created

Definition at line 72 of file entity.cpp.

UMLUniqueConstraint * UMLEntity::createUniqueConstraint ( const QString &  name = QString()  ) 

Creates a Unique Constraint for this Entity.

Parameters:
name An optional name
Returns:
The UniqueConstraint created

Todo:
check parameter

Definition at line 115 of file entity.cpp.

UMLForeignKeyConstraint * UMLEntity::createForeignKeyConstraint ( const QString &  name = QString()  ) 

Creates a Foreign Key Constraint for this Entity.

Parameters:
name An optional name
Returns:
The ForeignKeyConstraint created

Definition at line 162 of file entity.cpp.

UMLCheckConstraint * UMLEntity::createCheckConstraint ( const QString &  name = QString()  ) 

Creates a Check Constraint for this Entity.

Parameters:
name An optional name
Returns:
The CheckConstraint created

Definition at line 207 of file entity.cpp.

UMLObject * UMLEntity::addEntityAttribute ( const QString &  name,
Uml::IDType  id = Uml::id_None 
)

Adds an entityAttribute to the entity.

Parameters:
name The name of the entityAttribute.
id The id of the entityAttribute (optional.) If omitted a new ID is assigned internally.
Returns:
Pointer to the UMLEntityAttribute created.

Definition at line 251 of file entity.cpp.

bool UMLEntity::addEntityAttribute ( UMLEntityAttribute *  att,
IDChangeLog *  Log = 0 
)

Adds an already created entityAttribute.

The entityAttribute object must not belong to any other concept.

Parameters:
att Pointer to the UMLEntityAttribute.
Log Pointer to the IDChangeLog.
Returns:
True if the entityAttribute was successfully added.

Definition at line 260 of file entity.cpp.

bool UMLEntity::addEntityAttribute ( UMLEntityAttribute *  att,
int  position 
)

Adds an entityAttribute to the entity, at the given position.

If position is negative or too large, the entityAttribute is added to the end of the list.

Parameters:
att Pointer to the UMLEntityAttribute.
position Position index for the insertion.
Returns:
True if the entityAttribute was successfully added.

Definition at line 277 of file entity.cpp.

int UMLEntity::removeEntityAttribute ( UMLClassifierListItem *  a  ) 

Removes an entityAttribute from the class.

Parameters:
a The entityAttribute to remove.
Returns:
Count of the remaining entityAttributes after removal. Returns -1 if the given entityAttribute was not found.

Definition at line 295 of file entity.cpp.

void UMLEntity::signalEntityAttributeRemoved ( UMLClassifierListItem *  eattr  ) 

Emit the entityAttributeRemoved signal.

Definition at line 314 of file entity.cpp.

int UMLEntity::entityAttributes (  ) 

Returns the number of entityAttributes for the class.

Returns:
The number of entityAttributes for the class.

Definition at line 309 of file entity.cpp.

bool UMLEntity::setAsPrimaryKey ( UMLUniqueConstraint *  uconstr  ) 

Sets the UniqueConstraint passed as the Primary Key of this Entity If the UniqueConstraint exists, then it is made a primary key Else the UniqueConstraint is added and set as PrimaryKey.

Parameters:
uconstr The Unique Constraint that is to be set as Primary Key
Returns:
true if Primary key could be set successfully

Definition at line 404 of file entity.cpp.

void UMLEntity::unsetPrimaryKey (  ) 

Unset a Primary Key Constraint if it exists, else does nothing This function will make the primary key into just another UniqueConstraint if it exists.

Definition at line 437 of file entity.cpp.

bool UMLEntity::hasPrimaryKey (  )  const

Checks if This UMLEntity has a primary key set.

Returns:
true if a Primary Key Exists for this UMLEntity

Definition at line 441 of file entity.cpp.

bool UMLEntity::isPrimaryKey ( UMLUniqueConstraint *  uConstr  )  const

Checks if a given Unique Constraint is primary key of this entity.

Parameters:
uConstr A Unique Constraint
Returns:
bool true if passed paramater is a primary key of this entity

Definition at line 538 of file entity.cpp.

bool UMLEntity::addConstraint ( UMLEntityConstraint *  constr  ) 

Adds a Constraint to this UMLEntity To set a UMLUniqueConstraint as Primary Key use setAsPrimaryKey.

Parameters:
constr The UMLEntityConstraint that is to be added
Returns:
true if the constraint could be added successfully

Definition at line 449 of file entity.cpp.

bool UMLEntity::removeConstraint ( UMLEntityConstraint *  constr  ) 

Removes an existing constraint from this UMLEntity If the Contraint is a Primary Key, this Entity will no longer have a PrimaryKey.

Parameters:
constr The constraint to be removed
Returns:
true if the constraint could be removed successfully

Definition at line 465 of file entity.cpp.

bool UMLEntity::resolveRef (  )  [virtual]

Resolve the types referenced by our UMLEntityAttributes.

Reimplements the method from UMLClassifier.

Reimplemented from UMLClassifier.

Definition at line 318 of file entity.cpp.

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

Creates the <UML:Entity> element including its entityliterals.

Reimplemented from UMLClassifier.

Definition at line 340 of file entity.cpp.

UMLClassifierListItemList UMLEntity::getFilteredList ( Uml::Object_Type  ot  )  const [virtual]

Reimplementation of getFilteredList to support ot=Umlot_EntityConstraint.

Reimplemented from UMLClassifier.

Definition at line 507 of file entity.cpp.

UMLEntityAttributeList UMLEntity::getEntityAttributes (  )  const

Returns the Entity Attributes Same as getFilteredList(Uml::ot_EntityAttribute).

Definition at line 546 of file entity.cpp.

void UMLEntity::entityAttributeAdded ( UMLClassifierListItem *   )  [signal]

void UMLEntity::entityAttributeRemoved ( UMLClassifierListItem *   )  [signal]

void UMLEntity::entityConstraintAdded ( UMLClassifierListItem *   )  [signal]

void UMLEntity::entityConstraintRemoved ( UMLClassifierListItem *   )  [signal]

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

Loads the <UML:Entity> element including its entityAttributes.

Reimplemented from UMLClassifier.

Definition at line 357 of file entity.cpp.


The documentation for this class was generated from the following files:
  • entity.h
  • entity.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"
  • kate
  •     kate
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.4
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