Here you can find the source of sortInputQueryKeys(List l)
Parameter | Description |
---|---|
l | a parameter |
public static void sortInputQueryKeys(List l)
//package com.java2s; /*L/*www . j a v a 2 s . c om*/ * Copyright Washington University at St. Louis * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/geneconnect/LICENSE.txt for details. */ import java.util.List; public class Main { /** * Sort the input query list * @param l */ public static void sortInputQueryKeys(List l) { for (int i = 0; i < l.size(); i++) { for (int j = 0; j < l.size() - 1; j++) { String k1 = (String) l.get(j); int k = j + 1; String k2 = (String) l.get(k); String i1 = k1.substring(k1.indexOf(":") + 1, k1.indexOf("_")); String i2 = k2.substring(k2.indexOf(":") + 1, k2.indexOf("_")); if (Integer.decode(i1).intValue() > Integer.decode(i2).intValue()) { l.remove(j); l.add(j, k2); l.remove(k); l.add(k, k1); } } } } }