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

umbrello/umbrello

UMLEntity Class Reference

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

#include <entity.h>

Inheritance diagram for UMLEntity:
Inheritance graph
[legend]

List of all members.

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 addConstraint (UMLEntityConstraint *constr)
bool addEntityAttribute (UMLEntityAttribute *att, int position)
bool addEntityAttribute (UMLEntityAttribute *att, IDChangeLog *log=0)
UMLObject * addEntityAttribute (const QString &name, Uml::IDType id=Uml::id_None)
virtual UMLObject * clone () const
virtual void copyInto (UMLObject *lhs) const
virtual UMLAttribute * createAttribute (const QString &name=QString(), UMLObject *type=0, Uml::Visibility vis=Uml::Visibility::Private, const QString &init=QString())
UMLCheckConstraint * createCheckConstraint (const QString &name=QString())
UMLForeignKeyConstraint * createForeignKeyConstraint (const QString &name=QString())
UMLUniqueConstraint * createUniqueConstraint (const QString &name=QString())
int entityAttributes ()
UMLEntityAttributeList getEntityAttributes () const
UMLClassifierListItemList getFilteredList (Uml::Object_Type ot) const
bool hasPrimaryKey () const
bool isPrimaryKey (UMLUniqueConstraint *uConstr) const
virtual UMLClassifierListItem * makeChildObject (const QString &xmiTag)
bool operator== (const UMLEntity &rhs)
bool removeConstraint (UMLEntityConstraint *constr)
int removeEntityAttribute (UMLClassifierListItem *att)
virtual bool resolveRef ()
virtual void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
bool setAsPrimaryKey (UMLUniqueConstraint *uconstr)
void signalEntityAttributeRemoved (UMLClassifierListItem *eattr)
void unsetPrimaryKey ()

Protected Member Functions

bool load (QDomElement &element)

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 34 of file entity.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 41 of file entity.cpp.

UMLEntity::~UMLEntity (  )  [virtual]

Standard destructor.

Definition at line 53 of file entity.cpp.


Member Function Documentation

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 573 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. TODO: give default value -1 to position (append) - now it conflicts with the method above..

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

Definition at line 348 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 322 of file entity.cpp.

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

Adds an entityAttribute.

The entityAttribute object must not belong to any other concept.

Parameters:
name name of the UMLEntityAttribute
id id of the UMLEntityAttribute
Returns:
True if the entityAttribute was successfully added.

Definition at line 305 of file entity.cpp.

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

Make a clone of this object.

Reimplemented from UMLClassifier.

Definition at line 84 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 70 of file entity.cpp.

UMLAttribute * UMLEntity::createAttribute ( const QString &  name = QString(),
UMLObject *  type = 0,
Uml::Visibility  vis = Uml::Visibility::Private,
const QString &  iv = QString() 
) [virtual]

Create an UMLAttribute.

Parameters:
name an optional name for the attribute
type an optional type object for the attribute
vis the visibility of the attribute
iv the initial value for the attribute
Returns:
the just created attribute or null

Reimplemented from UMLClassifier.

Definition at line 100 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 254 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 205 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 151 of file entity.cpp.

void UMLEntity::entityAttributeAdded ( UMLClassifierListItem *   )  [signal]
void UMLEntity::entityAttributeRemoved ( UMLClassifierListItem *   )  [signal]
int UMLEntity::entityAttributes (  ) 

Returns the number of entityAttributes for the class.

Returns:
The number of entityAttributes for the class.

Definition at line 391 of file entity.cpp.

void UMLEntity::entityConstraintAdded ( UMLClassifierListItem *   )  [signal]
void UMLEntity::entityConstraintRemoved ( UMLClassifierListItem *   )  [signal]
UMLEntityAttributeList UMLEntity::getEntityAttributes (  )  const

Returns the Entity Attributes.

Same as getFilteredList(Uml::ot_EntityAttribute).

Definition at line 689 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 642 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 558 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 parameter is a primary key of this entity

Definition at line 676 of file entity.cpp.

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

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

Reimplemented from UMLClassifier.

Definition at line 456 of file entity.cpp.

UMLClassifierListItem * UMLEntity::makeChildObject ( const QString &  xmiTag  )  [virtual]

Create a new ClassifierListObject (entityattribute) according to the given XMI tag.

Returns NULL if the string given does not contain one of the tags <UML:EntityAttribute> Used by the clipboard for paste operation. Reimplemented from UMLClassifier for UMLEntity

Reimplemented from UMLClassifier.

Definition at line 710 of file entity.cpp.

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

Overloaded '==' operator.

Reimplemented from UMLClassifier.

Definition at line 61 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 596 of file entity.cpp.

int UMLEntity::removeEntityAttribute ( UMLClassifierListItem *  att  ) 

Removes an entityAttribute from the class.

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

Definition at line 372 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 409 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 435 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 510 of file entity.cpp.

void UMLEntity::signalEntityAttributeRemoved ( UMLClassifierListItem *  eattr  ) 

Emit the entityAttributeRemoved signal.

Definition at line 400 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 549 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"
  • 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