UniqueList purpose?
hrstoyanov opened this issue · comments
Hristo I Stoyanov commented
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?
Hristo I Stoyanov commented
...ok, i think i know why you need it ...
Ivan Vasilev commented
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).