how to sort vector having one dim. array as a element.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   pranav_k
Posted On:   Saturday, June 22, 2002 05:28 AM

i am haiving a array of string but the elements of the array are of following type 0th is a string 1st is data 2nd is int array a = {"a", "12-10-2000", "1"}; array b = {"b", "12-9-2002", "5"}; array c = {"c", "12-10-2001", "11"}; and these array i had stored in the vector i.e. v.addElememt(a); v.addElememt(b); v.addElememt(c); now i want to sort the vector date wise or by number or by string. how to do that ? or any other solution to achive this stuff avo   More>>

i am haiving a array of string but the elements of the array are of following type


0th is a string

1st is data

2nd is int


array a = {"a", "12-10-2000", "1"};


array b = {"b", "12-9-2002", "5"};


array c = {"c", "12-10-2001", "11"};




and these array i had stored in the vector


i.e. v.addElememt(a);


v.addElememt(b);


v.addElememt(c);



now i want to sort the vector date wise or by number or by string.



how to do that ? or any other solution to achive this stuff avoiding the vector .
thanking you.

Pranav

   <<Less

Re: how to sort vector having one dim. array as a element.

Posted By:   Mike_Friedrich  
Posted On:   Saturday, June 29, 2002 02:41 PM

Write your own comparator and use java.util.Arrays.sort(Object[] a, Comparator c)
About | Sitemap | Contact