Re: Sorting a vector based on another datas
- From: Andreas Leitgeb <avl@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 31 Jan 2007 17:41:41 GMT
zelao.itu@xxxxxxxxx <zelao.itu@xxxxxxxxx> wrote:
Could I insert these values in a Map Collection and then sort it by
any term that I choose
Yes, but you can also sort the Vector elements directly
(without shuffling around between various collection types)
by implementing your specific Comparator derived class, which
implements compare(x,y) according to the order you have in mind,
and passing an instance of your Comparator to Collections'
sort(List<T> list, Comparator<? super T> c) method.
(yes, a Vector is also a List)
.
- References:
- Sorting a vector based on another datas
- From: zelao.itu@xxxxxxxxx
- Re: Sorting a vector based on another datas
- From: Lew
- Re: Sorting a vector based on another datas
- From: zelao.itu@xxxxxxxxx
- Sorting a vector based on another datas
- Prev by Date: Re: 2D lookup table
- Next by Date: Re: Java Problem!!!
- Previous by thread: Re: Sorting a vector based on another datas
- Next by thread: Re: Sorting a vector based on another datas
- Index(es):
Relevant Pages
|