Here you can find the source of sortIds(List
Parameter | Description |
---|---|
ids | to be sorted |
public static void sortIds(List<String> ids)
//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); } }