I have 2 strings from twitter JSON "follower_count" and "user id"
i need something to sort them according to favourite count in descending order, i.e with greater Follower count gets placed first and then access their "user id" link. and print from 1 to 10.
Best way to do that in java/android with hashmap or linked hashmap or any other ?
Update:- i used sorted maps as suggested, actually Treemap
here is my progress so far:
//get the first status
status = statuses.get(0);
//get id of the status
long l= status.getId();
//get retweeters id
ki =twitter.getRetweeterIds(l, 100, -1);
long[] id=ki.getIDs();
//for every retweeter id, get followers count and put in treemap
TreeMap<Integer,Long> tm = new TreeMap<Integer, Long>();
for(int k=0;k<=id.length;k++)
{
u = twitter.showUser(id[k]);
follower=u.getFollowersCount();
tm.put(follower,id[k] );
}
NavigableMap<Integer,Long> reverseTreeMap = tm.descendingMap();