Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniqueList purpose? #18

Closed
hrstoyanov opened this issue Apr 20, 2014 · 2 comments
Closed

UniqueList purpose? #18

hrstoyanov opened this issue Apr 20, 2014 · 2 comments

Comments

@hrstoyanov
Copy link

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?

@hrstoyanov
Copy link
Author

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

@ivan-vasilev
Copy link
Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants