Tresa Rose

Greenhorn
+ Follow
since Mar 06, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Tresa Rose

Yes, you are right Keith.

Each Drawing object has its own version number (May be more than one). I am querying the database and for each Drawing object, am putting its associated versions into an array. (This is the drwgVerNo array).

I think its better to rename the Drawing class as QueryResultDrawing.


Do longer arrays come before shorter ones? Or do you want to sort by version number somehow?



Garrett,
Longer arrays come before shorter ones. If they are of the same size, then they need to be sorted by the version number.

Please indicate how to proceed with the above.

Thanks for the prompt responses.
17 years ago
Hi,

I need to sort an ArrayList of Drawing objects. The Drawing objects should be sorted on the creator and then on the version number.



Please tell me how the objects can be sorted based on the array.

Thanks
Tresa
17 years ago
Thank you Paul for your inputs.
I came across something like this.



Please advise if there is a better way of doing the same in terms of performance and maintainability of code.

Many Thanks
Tresa
17 years ago
Hi,

I have an ArrayList containing some Person objects.
The Person class has the following attributes, all of which are of type
String. (A person may have multiple roles.)

p_id
p_name
p_role
p_manager
p_salary

Based on a flag, this ArrayList should be sorted using multiple fields.
That is ,


Can you please explain how the ArrayList can be sorted on multiple attributes.

Many thanks.
17 years ago