[gme-users] Ordering in GME Enumeration Values?

Joe Hoffert jhoffert at dre.vanderbilt.edu
Fri Oct 27 11:55:30 CDT 2006


Hi, Zoli.

Thanks for the response. Regardless, it sounds like I can't use relative
comparison operators (i.e., <, >, <=, >=) in OCL constraint rules even if I
assign explicit values. That's why I was asking.

-Joe

> From: gme-users-bounces at list.isis.vanderbilt.edu [mailto:gme-users-
> bounces at list.isis.vanderbilt.edu] On Behalf Of Zoltan Molnar
> Sent: Friday, October 27, 2006 10:44 AM
> 
> If you don't specify explicit values for enum items then each distinct
> item's value becomes the item itself.
> For example,
> 1
> 2
> 3
> defined in the meta as an enumeration, might look like in the xmp file:
> <enumitem dispname = "1" value = "1"></enumitem>
> <enumitem dispname = "2" value = "2"></enumitem>
> <enumitem dispname = "3" value = "3"></enumitem>
> 
> Another definition (explicit value assignment):
> One, 1
> Two, 2
> Three, 3
> results in the following xmp:
> <enumitem dispname = "One" value = "1"></enumitem>
> <enumitem dispname = "Two" value = "2"></enumitem>
> <enumitem dispname = "Three" value = "3"></enumitem>
> 
> Values are comparable in such cases, because from Bon2 you can ask
> myAttr->getIntegerValue().
> 
> They are not comparable, in case of the
> One
> Two
> Three
> definition, where values will be "One", "Two", ..., so you must use
> myAttr->getStringValue() in such cases.
> 
> So the C++ comparison trick is possible only in certain cases, when
> integer-convertible values are found in the enum.
> 
> Zoli
> 
> 
> -----Original Message-----
> From:	gme-users-bounces at list.isis.vanderbilt.edu on behalf of Joe H.
> Sent:	Fri 10/27/2006 7:44 AM
> To:	gme-users
> Cc:
> Subject:	[gme-users] Ordering in GME Enumeration Values?
> 
> Hello.
> 
> 
> 
> I have a question concerning enumeration values modeled in GME. Do the
> values take on ascending order like they do in C/C++? For example, if I
> specify an enumeration in GME with values of yellow, red, and then blue
> can
> I do a comparison to see if an enumeration value is less than blue? This
> would be very helpful for me in defining my OCL constraints but I wasn't
> sure if GME supports this.
> 
> 
> 
> Thanks.
> 
> 
> 
> -Joe
> 
> 
> 
> 
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users



More information about the gme-users mailing list