ivan-vasilev/neuralnetworks

UniqueList purpose?

hrstoyanov opened this issue · 2 comments

Ivan,
What is the purpose of the UniqueList class? If you needed a Set that also preserves the order of insertion, you could use LinkedHashSet, otherwise just use HashSet?

...ok, i think i know why you need it ...

I'll try to explain anyway. As you mentioned LinkedHashSet would do the same job. However, I think that approach has two drawbacks:

  • you cannot do listObject.get(N),
  • during step-by-step debugging it's much easier to see the contents of a list, rather than a set (at least in eclipse it is).