Using EMFs as keys

Is it possible to implement EMF objects hashCodeand equals? I would like to be able to use the model object as a key in HashMap.

+5
source share
4 answers

EObject javadoc about this is clear. EObject may not specialize in hashCodeor equals. However, you can use them on maps if you know about the semantics of identity Object#equals(..)and #hashCode.

+8
source

EMF, - EObject equals hashCode EO, . - , , .

, . , - , , .

+1

EcoreUtil.equals(), , , .

+1

() equals/hashCode EMF-*Impl. @generated not .

-1
source

All Articles