EDataType and '<' operation in OCL expression [message #566104] |
Tue, 07 February 2006 17:07 |
Radomil Dvorak Messages: 249 Registered: July 2009 |
Senior Member |
|
|
Hi,
Is '<' operation defined for EDataType which points by
EDataType::instanceClass to a java class which
implements Comparable?
As mentioned in the thread 'order of returned items', the 'sortedBy'
operation on collections implemented by EMFT
understands the definition of '<' operation as implementation of
'java.lang.Comparable' interface.
It works for me in the following example with use of ecore::EDate:
This is the context classifier described in emfatic source.
class Topic {
attr String[1] name;
attr Date startDate;
attr Date endDate;
}
1) the following expression works fine and is evaluated by using
'java.util.Date.compareTo'.
Bag { startDate, endDate }->sortedBy(d|d)->last() = endDate
2) but the expression below fails with: "AnyType: the source of operation:
(lessThan) must be an EClass"
startDate < endDate
Am I wrong to expect that if '<' was found as defined in 'sortedBy' it
should be resolved also in the second expression?
Regards,
/Radek
|
|
|
Powered by
FUDForum. Page generated in 0.02182 seconds