What's the right Java generic for a collection of elements with unique addressable indices?

Posted by Rocreex on Stack Overflow See other posts from Stack Overflow or by Rocreex
Published on 2013-10-27T21:36:10Z Indexed on 2013/10/27 21:53 UTC
Read the original article Hit count: 159

Filed under:
|
|

I'm on my way to programming a database application and in our course we are told to implement a library of elements using one of the Java Collections. Each of the elements has a unique ID with which it's supposed to be addressed. Now I am wondering how this can be done.

I though about using a ListArray but this won't work because the only way of addressing List elements is through the index which you can't control.

Do you have some advice for me?

© Stack Overflow or respective owner

Related posts about java

Related posts about database