As per the API docs, Vector
just implements List
, so I don't forsee problems. Maybe your confusion was caused because you declared Vector
according the old Java 1.0 style:
Vector vector = new Vector();
instead of the declaring it aginst the interface (which is considered good practice):
List list = new Vector();
You can thus just make use of Collections#sort()
to sort a collection, Comparable
to define the default ordering behaviour and/or Comparator
to define an external controllable ordering behaviour.
Here's a Sun tutorial about ordering objects: http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html
Here's another SO answer with complete code examples: http://stackoverflow.com/questions/1814095/sorting-an-arraylist-of-contacts/1814112#1814112
That said, why are you still sticking to the legacy Vector
class? If you can, just replace by the improved ArrayList
which was been designed as replacement of Vector
more than a decade ago.