I'm in the process of creating a ranking class but was wondering if there is already any existing implementations.

Functionality needed (these will move the other ranks up/down appropriately) :

* increase/decrease rank
* move to first/last rank
* move to rank (x)
* check for any gaps in the rank, is so move the ranks around to get rid of the gaps. i.e. 1,2,4,5 will be updated to 1,2,3,4
* check duplicate ranks. If there are duplicate ranks, set one of them down a rank (probably the oldest object) and move the other objects down the ranks.
* Object getObjectAtRank(x)
* Int getObjectRank(object)

Are there any exisiting classes that I can extend or am I better off doing it from scratch?

Possibly with a Map using but there would be problems with duplicate ranks etc.

Thanks!

**Edit** some additional info

The objects I am ranking are Jira Issues, these will have a rank field which I will read in so if an issue is deleted there could be a gap in the ranking.