1

コピーHashMap先の一連のステートメントTreeMap

private Map<String,Bitmap> imageFilexx= new HashMap<String,Bitmap>();

//Assuming map has values
printMap(imageFilexx);
TreeMap<String,Bitmap> imageFilexxS;
imageFilexxS= new TreeMap<String,Bitmap>(imageFilexx);
printMap(imageFilexxS);

地図の上に表示する機能:

public static void printMap(Map<String, Bitmap> map) {
        for (Map.Entry entry : map.entrySet()) {
            System.out.println("Key : " + entry.getKey());
        }
    }

入力:

Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p7.png  
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p1.png 
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p5.png 
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p3.png 
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p11.png 
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p9.png 

現在のO/P:

Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p1.png
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p11.png //11 should be displayed in the last 
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p3.png 
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p5.png
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p7.png
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p9.png 

期待される O/P:

Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p1.png
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p3.png 
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p5.png
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p7.png
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p9.png
Key : http://myserver.com/myfolder/ImageDesc/ImageDesc%20p11.png
4

1 に答える 1