Lets say I have a list of keys that all contain an Object like this:
2, 4, 5, 9, 11
I need them to be ordered because I want to do something like:
function Object[] getObjectsAfter( int i );
// so 4 would result in an array of objects in the keys 5, 9 and 11
and
function Object[] getObjectsBefore( int i );
// so 4 would result in an array of objects in the keys 2
What collection is best to use in Android? I tried SparseArray and TreeMap, but I can't find a way to iterate from a certain point.