Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Why does IMatchPolicy.getMatchID return a comparable?
Why does IMatchPolicy.getMatchID return a comparable? [message #1409529] Mon, 18 August 2014 10:46 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
Hi,

I wonder why IMatchPolicy.getMatchID should return a comparable? Is
there any need to define an order on match IDs? I imagine we only want
to find out if two objects match id are equal, not if one id is "bigger"
or "smaller" than the other one. We could then maybe change the return
type of IMatchPolicy.getMatchID to 'Object' and just use Object.equals
to find if two objects match according to the policy.

Thanks for clarifying,
Felix
Re: Why does IMatchPolicy.getMatchID return a comparable? [message #1409872 is a reply to message #1409529] Tue, 19 August 2014 07:30 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 90
Registered: January 2012
Member
Hi Felix,

You do not need to return a Comparable any more in v0.3.0 (June 2014 release). You may return any Object, see IMatchPolicy#getMatchID.

Still, you have the possibility to return a Comparable or use a Comparator (see IMatchPolicy#getMatchIDComparator). This has no impact on functionality since things work exactly the way you describe; it only has an impact on performance. The javadoc of IMatchPolicy provides an explanation if you are interested. Before v0.3.0, it was mandatory to return a Comparable in order to obtain certain performance characteristics; now the choice is left to the user/customiser of the tool.

Hope it helps!

Olivier
Previous Topic:How to totally hide Merge dialogs ?
Next Topic:Delegate label provider question
Goto Forum:
  


Current Time: Sat Feb 24 02:51:39 GMT 2018

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

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