Problems with multiplicity association

Problems with multiplicity association

Postby Guest » Mon Jun 20, 2005 6:08 pm


I'm trying to read the value of both multiplicities of one association.

I'm using AssEnd.getMultiplicity().getRange() but my output is not the value of two cardinalities.

My output is

Anybody can help me?


Re: Problems with multiplicity association

Postby [gw] Stefan Mueller » Tue Jun 28, 2005 9:43 am


getRange() return a Collection which includes object of class
Each MultiplicityRange has an 'upper' and 'lower'. So the collection represents the Multiplicity of ONE associationEnd, e.g.: 2-4, 5-9, 20-30. This list of ranges is allowed in UML 1.4.
To get the multiplicity of the 'other side' of the aossication you need to get the associatinEnd of the opposite end and get the MultiplicityRange for it.

To get the AssociationEnds of an association you can get association.getConnection(). It returns a list of all AssociationEnds of this association (normally 2 if it is an binary association).


Stefan Mueller
Stefan Mueller [Gentleware]
[gw] Stefan Mueller
Posts: 374
Joined: Thu Jul 03, 2003 11:24 am

Return to Plug-Ins

Who is online

Users browsing this forum: No registered users and 4 guests