Re: sort an array

2006-06-28 Thread Marc Farrow
Password, You need to move this line of questioning to a Java Forum. The questions you are asking has nothing to do with Tomcat running/setup. On 6/28/06, password password <[EMAIL PROTECTED]> wrote: Hi I have created this class (ExampleClass as Ségio told me) but and I don't know how i can

Re: sort an array

2006-06-28 Thread password password
Hi I have created this class (ExampleClass as Ségio told me) but and I don't know how i can see the content the List with the position. I have put this but it return an error for (int i = 0; i < listToSort.size(); i++) { System.out.println(listToSort.get(i)); } S

Re: sort an array

2006-06-27 Thread Martin Gainty
and destroy the original message without making a copy. Thank you. - Original Message - From: "password password" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Tuesday, June 27, 2006 12:03 PM Subject: Re: sort an array > >Yes, you need to crea

RE: sort an array

2006-06-27 Thread Gordon Smith
this helps. Cheers, Gordon Smith -Original Message- From: password password [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 10:57 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: sort an array Hi, Arrays.sort(astrName); I can not use the sort method because

Re: sort an array

2006-06-27 Thread Marc Farrow
This is just basic Java coding. Search on google for an example. I am sure there are tons out there. On 6/27/06, password password <[EMAIL PROTECTED]> wrote: >Yes, you need to create an array of a data bean/value bean/private class >(whatever buzz word you want to give) and then sort that arra

Re: sort an array

2006-06-27 Thread password password
>Yes, you need to create an array of a data bean/value bean/private class >(whatever buzz word you want to give) and then sort that array. So you >would have an array of arrays and then sort the array of arrays. Can you put an example of this (array of arrays)? How can I do the order with this

Re: sort an array

2006-06-27 Thread Marc Farrow
array. Robert S. Harper Information Access Technology, Inc. -Original Message- From: password password [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 8:57 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: sort an array Hi, Arrays.sort(astrName); I can not use th

RE: sort an array

2006-06-27 Thread Robert Harper
remove it from the other array. Robert S. Harper Information Access Technology, Inc. -Original Message- From: password password [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 8:57 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: sort an array Hi, Arrays.sort

Re: sort an array

2006-06-27 Thread johnny
omcat Users List , [EMAIL PROTECTED] cc Subject Re: sort an array Hi, Arrays.sort(astrName); I can not use the sort method because I have the arrays have an relation. I mean, the first element of astrName have relation with first element of adblBackground1, adblBackground2, a

Re: sort an array

2006-06-27 Thread password password
Hi, Arrays.sort(astrName); I can not use the sort method because I have the arrays have an relation. I mean, the first element of astrName have relation with first element of adblBackground1, adblBackground2, adblItensity1 and adblItensity2. Then I can sort each array indepe

Re: sort an array

2006-06-27 Thread Sérgio Costa
This first class should be you domain object. You should add all related data here. public class ExampleClass implements Comparable { public String astrName; /* * All other members you need here * */ public ExampleClass(String astrName) { this.astrName = astrName;

Re: sort an array

2006-06-27 Thread Marc Farrow
Search on Interface of Collections (specifically the comparable method). This should allow you to write your own way to compare objects and thus the Java engine will sort based upon your comparable method. On 6/27/06, password password <[EMAIL PROTECTED]> wrote: Hi, Arrays.sort(astrName);

Re: sort an array

2006-06-27 Thread password password
Hi, Arrays.sort(astrName); I can not use the sort method because I have the arrays have an relation. I mean, the first element of astrName have relation with first element of adblBackground1, adblBackground2, adblItensity1 and adblItensity2. Then I can sort each array indepe

Re: sort an array

2006-06-27 Thread Rajeev N. Jha
Looks like you are using 2 order N loops. why not use quicksort ? Tomcat may have nothing to do with it. Thanks - Rajeev. password password wrote: Please, can you put an example? I don't know how put the compareTo Method in my servlet. Sérgio Costa <[EMAIL PROTECTED]> escribió: Put them in

Re: sort an array

2006-06-27 Thread Pid
You put the compareTo object on the object to be compared. You could also try: java.utils.Arrays.sort(Object[] array, Comparator comp) There are plenty of tutorials to be found via Google on the use of both this and Collections.sort(). password password wrote: > Please, can you put an example?

Re: sort an array

2006-06-27 Thread password password
Please, can you put an example? I don't know how put the compareTo Method in my servlet. Sérgio Costa <[EMAIL PROTECTED]> escribió: Put them in a list and Collections.sort() them. All you'll need to do is create a Class with all those fields implementing Comparable, and implement the compareTo

Re: sort an array

2006-06-26 Thread Sérgio Costa
Put them in a list and Collections.sort() them. All you'll need to do is create a Class with all those fields implementing Comparable, and implement the compareTo Method. hope it helps SC On 6/26/06, password password <[EMAIL PROTECTED]> wrote: Hi, I have a servlet and in this servlet I h