Java List Sort sortIds(List ids)

Here you can find the source of sortIds(List ids)

Description

Sorts the list of IDs.

License

Open Source License

Parameter

Parameter Description
ids to be sorted

Declaration

public static void sortIds(List<String> ids) 

Method Source Code

//package com.java2s;
/*//from  ww  w. j  av  a2s  .co  m
 * This file is part of Transitime.org
 * 
 * Transitime.org is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License (GPL) as published by the
 * Free Software Foundation, either version 3 of the License, or any later
 * version.
 * 
 * Transitime.org is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * Transitime.org . If not, see <http://www.gnu.org/licenses/>.
 */

import java.util.Collections;

import java.util.List;

public class Main {
    /**
     * Sorts the list of IDs. Uses a regular string sort. Much faster than
     * sorting IDs numerically because don't need to pad the IDs in order for
     * them to be ordered properly. But then number won't be in the proper
     * order. For example, "10" will end up before "9".
     * 
     * @param ids
     *            to be sorted
     */
    public static void sortIds(List<String> ids) {
        Collections.sort(ids);
    }
}

Related

  1. sortedInsert(List list, E e, Comparator c)
  2. sortedInsert(List list, T item, Comparator comparator)
  3. sortedList(List list)
  4. sortedUnion(List args1, List args2)
  5. sortEntrySetToList(Set> set)
  6. sortIfUnsorted(List genomes)
  7. sortInputQueryKeys(List l)
  8. sortItems(List items, String putOnTop)
  9. sortList(ArrayList list)