Remove Dublicate entries in Java Vector
I was writing a small java program, that copied some ids from a website. Then the program had to process each one of those ids.
I used Vector to store these, then i realized that there are a lot of duplicates. To late to change to something else, Like hash or something, so i needed the way to remove double values in java Vector.
Turns out that this is very easy. I give you the solution:
Vector vector = new Vector();
vector = new Vector(new LinkedHashSet(vector));
The result is the same variable that contains unique entries this time.