Re: Any API to sort this Vector?
From: Michael Borgwardt (brazil_at_brazils-animeland.de)
Date: 07/16/04
- Next message: dave: "Exception in thread "main" java.lang.NoClassDefFoundError:"
- Previous message: Tor Iver Wilhelmsen: "Re: Any API to sort this Vector?"
- In reply to: Edith: "Any API to sort this Vector?"
- Next in thread: Edith: "Re: Any API to sort this Vector?"
- Reply: Edith: "Re: Any API to sort this Vector?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Jul 2004 14:35:41 +0200
Edith wrote:
> I have a vector consists of object of String Array.
> i.e. my vector is:
> [ {"user3", "privilege4"}, {"user2", "privilege1"}, {"user3", "privilege2"},
> etc ]
>
> Are there any API so that I can sort this vector to give me:
> [ {"user2", "privilege1"}, {"user3", "privilege2"}, , {"user3",
> "privilege4"}, etc ]
> i.e. sort by first element then the second element.
Use java.util.Collections.sort() with a simple Comparator implementation to
handle the arrays.
- Next message: dave: "Exception in thread "main" java.lang.NoClassDefFoundError:"
- Previous message: Tor Iver Wilhelmsen: "Re: Any API to sort this Vector?"
- In reply to: Edith: "Any API to sort this Vector?"
- Next in thread: Edith: "Re: Any API to sort this Vector?"
- Reply: Edith: "Re: Any API to sort this Vector?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
Loading