Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » how to define a constant field in an interface ?
how to define a constant field in an interface ? [message #418443] Wed, 16 April 2008 13:01 Go to next message
Eclipse UserFriend
Originally posted by: christophe.chevallier.ensmp.fr

Hello all,

I'm beginning with EMF, and I have a question for which I couldn't find answers on the newsgroups
archive nor on Google (except for something posted in 2002, so I don't know if the answer - ~"you
currently have to do it manually" - is still valid).

I'm wondering how to define a (public static final) constant value in an interface (or even in a
class) ?

Thank you for your help,

Chris.


PS : I want to integrate the JScience package in my EMF model. In the JScience package, interfaces
that extend the Quantity interface use a constant UNIT field to hold the SI unit of the Quantity. I
want to extend the Quantity interface, and so I need to define the UNIT constant value in my new
subinterface.
Re: how to define a constant field in an interface ? [message #418447 is a reply to message #418443] Wed, 16 April 2008 13:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Chris,

Yes, we have no support for modeling constants, other than in enums of
course, and that wouldn't help here...


cchris wrote:
> Hello all,
>
> I'm beginning with EMF, and I have a question for which I couldn't
> find answers on the newsgroups archive nor on Google (except for
> something posted in 2002, so I don't know if the answer - ~"you
> currently have to do it manually" - is still valid).
>
> I'm wondering how to define a (public static final) constant value in
> an interface (or even in a class) ?
>
> Thank you for your help,
>
> Chris.
>
>
> PS : I want to integrate the JScience package in my EMF model. In the
> JScience package, interfaces that extend the Quantity interface use a
> constant UNIT field to hold the SI unit of the Quantity. I want to
> extend the Quantity interface, and so I need to define the UNIT
> constant value in my new subinterface.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:References to all grandchildren's references
Next Topic:Problem with aliasings of ID values
Goto Forum:
  


Current Time: Fri Apr 26 01:14:13 GMT 2024

Powered by FUDForum. Page generated in 0.02602 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top