Сортировка списков

    Date: 02/19/09 (Code WTF)    Keywords: java

    Это у нас теперь так java.util.List сортируется.

        @SuppressWarnings(value = { "unchecked" })
        public List sortTimes(List studioTimes) {
            Object[] arr = studioTimes.toArray();
            Comparator comp = new StudioTimeComparator();
            Arrays.sort(arr, comp);
            List sortedTimes = new ArrayList();
            for (Object time : arr) {
                sortedTimes.add((StudioTime) time);
            }
            return sortedTimes;
        }
    

    Source: http://community.livejournal.com/code_wtf/158806.html

« Глубина-глубин... || Кошмар на... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home