Renumber an Array of Object

How would I renumber a property in an array of Object?

For instance, say I have 5 Projects each with it's own corresponding priority property. Say I want to change the priority of the 5th Project to have a priority of 1. Meaning that the orginial 1 -4 projects would be pushed down and their proirities changed accordingly. Is there an API out there that does this?

Thanks!

Pete

[404 byte] By [alcocerpia] at [2007-10-3 4:35:49]
# 1

Not sure of the API but a possible solution is to sort the object array by that particular object property at the time of its creation. Later when you change the property you can use the same method that traverses the array again and re-arranges the objects based on new priorities.

I agree this won't the most efficient solution but i'm sure you should be able to optimize it to some extent. :)

Hope it helps.

-ts

t.sa at 2007-7-14 22:39:28 > top of Java-index,Core,Core APIs...