Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » index in a collection(How can I get the index of an element in a collection)
index in a collection [message #714271] Wed, 10 August 2011 08:01 Go to next message
AmenieV  is currently offline AmenieV
Messages: 13
Registered: June 2011
Junior Member
Hi ,

How can I get the index of an element in a collection/bag with OCL?
Fo example I have this collection :
elem1
elem2
elem3

I want to get back 2 for elem2 for example.

Thaknx,
Regards

[Updated on: Wed, 10 August 2011 08:01]

Report message to a moderator

Re: index in a collection [message #714277 is a reply to message #714271] Wed, 10 August 2011 08:07 Go to previous message
AmenieV  is currently offline AmenieV
Messages: 13
Registered: June 2011
Junior Member
aaahh!! I use IndexOf()

indexOf(o:T):Integer
So Sorry!!!!!
Previous Topic:[OclInEcore] imported files not recognized
Next Topic:Operators with String : str1 contains str2 ?
Goto Forum:
  


Current Time: Tue Oct 21 13:46:56 GMT 2014

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

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