Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Operation of includes() operation
Operation of includes() operation [message #574774] Mon, 24 August 2009 11:19
Eclipse User
Originally posted by: c.k.holmes.lboro.ac.uk

Hi,
I have a class containing an attribute of type String, when instantiated
I expect the attribute to take any (one) of the values 'A', 'B', or
'C'. I wrote a simple helper operation to check the value against the
set of allowable values, however the include() operation doesn't appear
to return the expected result, see simple example below:

operation MyClass anOp() : Boolean {
var allowableItems : Set(String) := Set{'A', 'B', 'C'};
var item : String := 'B';
return allowableItems.includes(item);
}

It doesn't appear to be an address pointer issue as I can set item to
allowableItems.first() and still anOp() returns false. I think the
operation is running the following query:
Set{'A', 'B', 'C'}.includes('B')
Hence I expected the result 'true'. What am I doing incorrectly?

Best Wishes
Chris
Previous Topic:ANT Script for ETL
Next Topic:Operation of includes() operation
Goto Forum:
  


Current Time: Fri Aug 01 10:10:45 EDT 2014

Powered by FUDForum. Page generated in 0.01489 seconds