Entries for June, 2007

June 8, 2007
Sorting Map By Values in Descending Order
Posted at 04:49 PM

Daripada blog gak diupdate... mending diisi codingan iseng sy.. huheue
gak usah pake treebidimapnya jakarta apache commons..

TreeMap tm = new TreeMap();
tm.put(4L, 10f);
tm.put(2L, 1f);
tm.put(1L, 5f);
TreeSet set = new TreeSet(new Comparator(){
public int compare(Object obj, Object obj1) {
float o =((Float)((Map.Entry) obj).getValue()).floatValue();
float o1 =((Float)((Map.Entry) obj1).getValue()).floatValue();
if (o>o1) return -1;
else if (o<o1) return 1;
return 0;
}
});
set.addAll(tm.entrySet());
for (Iterator i = set.iterator(); i.hasNext(); ) {
Map.Entry entry = (Map.Entry) i.next();
System.out.println(entry.getKey() + " - " + entry.getValue());
}

output:

4 - 10.0
1 - 5.0
2 - 1.0



June 12, 2007
...
Posted at 08:39 AM

ok deh.. kerjain ni 'novel' sampe 'mati'...


June 18, 2007
'oleh-oleh'
Posted at 06:46 AM in Jalan Jalan

Kemaren abis moto2 dikraton, gak tau deh..pas diliat kok muncul beginian.. penampakan?

Untitled




herik
Muslim, Send an Instant Message  ym: her1k
View my complete profile

Arsip
Blog Temen-temen
Liputan Jalan-Jalan
Friends
Sites Visited
free hit counter


CREDITS:
Tagboard currently supported by myshoutbox, online user by fastonlineusers, picture by photobucket, uploadit and counter by statcounter.

JADWAL SHOLAT