How to create a set of nodes with specified equals method


I want to create a set of specified nodes in a behavior method. Since sets do not allow multiple equal elements there must be some equals check inside the add method. Different nodes with the same name (from IValidIdentifier) should be considered as equal in my case.

In pure java I would override the equals method or implement the comparable interface, but I don't know how to handle this with nodes.
1 comment
Comment actions Permalink
A Treeset allows you to specify a comparator:

set<node<INamedConcept>> set = new treeset({node<INamedConcept> a, node<INamedConcept> b =>; });

Please sign in to leave a comment.