I would like to sort a Vector of Vectors based on one element in the enclosed vectors.
Similar to sorting the rows of a JTable based on one column, but in this case there is no JTable.
Vector one = new Vector();
one.addElement( "al" );
one.addElement( "plumber" );
one.addElement( "25,000" );
Vector two = new Vector();
two.addElement( "bill" );
two.addElement( "engineer" );
two.addElement( "65,000" );
Vector three = new Vector();
three.addElement( "cathy" );
three.addElement( "marketing" );
three.addElement( "100,000" );
Vector workers = new Vector();
workers.addElement( "one" );
workers.addElement( "two" );
workers.addElement( "three" );
Is there any way to sort the "workers" vector based on the "name" vector?
i.e.: (Vector)workers.elementAt(x).elementAt(0);
Many thanks in advance