Tri des chaînes alphanumériques de java

J'ai ce tableau stockant le suffixe de certaines Url, l'utilisateur est d'ajouter:

[U2, U3, U1, U5, U8, U4, U7, U6]

Quand je fais ceci:

for (Map<String, String> map : getUrlAttachments()) {
            String tmpId = map.get("id"); //it receives the U2, in the 1st iteration, then U3, then U1,...
            if (tmpId.charAt(0) == 'U') {
                tmpId.charAt(1);//2, then 3, then 1,...
                String url = map.get("url");
                String description = map.get("description");
                URLAttachment attachment;
                String cleanup = map.get("cleanup");
                if (cleanup == null && url != null && description != null) {
                    attachment = new URLAttachmentImpl();
                    attachment.setOwnerClass(FileUploadOwnerClass.Event.toString());
                    attachment.setUrl(url);
                    attachment.setDescription(description);
                    attachment.setOwnerId(auctionHeaderID);
                    attachment.setUrlAttachmentType(URLAttachmentTypeEnum.EVENT_ATTACHMENT);
                    attachment.setDateAdded(new Date());
                    urlBPO.save(attachment);

            }

Mon problème:

Je veux changer ce For condition d'en passer une autre liste de cartographie des données triées comme [U1, U2, U3, U4, U5, U6, U7, U8].

J'aimerais votre aide pour savoir quel est le mieux que j'ai pu faire.

J'ai pensé à la création d'un tableau répertoriant les id et puis trier ensuite, mais je ne sais pas exactement comment trier des chaînes alphanumériques en java.

Jetez un oeil à TreeMap.

OriginalL'auteur periback2 | 2013-01-15