I am looking for an implementation of java.util.Queue or something in the Google collection that behaves like a queue, but also ensures that each element of the queue is unique. (all subsequent insertion will have no effect)
Is this possible, or will I have to do it manually?
Now I use the queue with the implementation of LinkedList, and I check the uniqueness before inserting. (I use the side map for this, add / remove an element from the side map before / after queu). I donβt really like it.
Any input is welcome. If it's not in the java.util package, maybe this is a bad idea?
java collections guava queue unique-constraint
Antoine Claval Feb 23 '10 at 15:01 2010-02-23 15:01
source share