ivan-vasilev / neuralnetworks

java deep learning algorithms and deep neural networks with gpu acceleration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UniqueList purpose?

hrstoyanov opened this issue · 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).