A
Albretch
Is there such a thing?
I need a Data Structure that would let you insert Strings into it and give you
back an index you could use later on to refer to the inserted String and it should
work the other way around too, given the String it should return to you the index
if the String exists.
In my code trials I have noticed that:
1._ Yes, a LinkedHashMap is really fast if you have the index, but you can not
get an iterator from it and, it is really slow when you effectively loop over it
via:
get(new Integer(Ix))
2._ A LinkedList is faster but still in order to get to an item you must get an
iterator and go over all of them and check them one by one
I am thinkign of using a class containing two Maps in order to solve the problem,
but there might be a more elegant solution to this prob.
I need a Data Structure that would let you insert Strings into it and give you
back an index you could use later on to refer to the inserted String and it should
work the other way around too, given the String it should return to you the index
if the String exists.
In my code trials I have noticed that:
1._ Yes, a LinkedHashMap is really fast if you have the index, but you can not
get an iterator from it and, it is really slow when you effectively loop over it
via:
get(new Integer(Ix))
2._ A LinkedList is faster but still in order to get to an item you must get an
iterator and go over all of them and check them one by one
I am thinkign of using a class containing two Maps in order to solve the problem,
but there might be a more elegant solution to this prob.