Example usage for java.util LinkedList get

List of usage examples for java.util LinkedList get

Introduction

In this page you can find the example usage for java.util LinkedList get.

Prototype

public E get(int index) 

Source Link

Document

Returns the element at the specified position in this list.

Usage

From source file:org.zywx.wbpalmstar.plugin.uexiconlist.utils.IconListUtils.java

public static int indexOfIconBeans(IconBean iconBean, LinkedList<IconBean> list) {
    int index = -1;
    for (int i = 0; i < list.size(); i++) {
        if (iconBean.getIconId().equals(list.get(i).getIconId())) {
            index = i;//from  w w w  .j a va2 s  .  c  o  m
            break;
        }
    }
    return index;
}

From source file:org.zywx.wbpalmstar.plugin.uexiconlist.utils.IconListUtils.java

public static boolean isIconExist(IconBean iconBean, LinkedList<IconBean> list) {
    boolean isExist = false;
    for (int i = 0; i < list.size(); i++) {
        if (iconBean.getIconId().equals(list.get(i).getIconId())) {
            isExist = true;//  w  ww .j a  v a 2 s  .  c om
            break;
        }
    }
    return isExist;
}

From source file:org.axe.util.StringUtil.java

/**
 * ??//  w  ww  .  j  a  v a  2 s .c  o  m
 */
public static List<String> sortStringList(List<String> stringList) {
    LinkedList<String> sortList = new LinkedList<>();
    if (CollectionUtil.isNotEmpty(stringList)) {
        for (String str : stringList) {
            if (sortList.size() == 0) {
                sortList.add(str);
                continue;
            }
            int j = 0;
            for (; j < sortList.size(); j++) {
                String sortStr = sortList.get(j);
                if (str.compareTo(sortStr) <= 0) {
                    sortList.add(j, str);
                    break;
                }
            }
            if (j == sortList.size()) {
                sortList.add(str);
            }
        }
    }
    return sortList;
}

From source file:org.axe.util.StringUtil.java

public static List<String> sortStringAry(String[] stringAry) {
    LinkedList<String> sortList = new LinkedList<>();
    if (stringAry != null && stringAry.length > 0) {
        for (String str : stringAry) {
            if (sortList.size() == 0) {
                sortList.add(str);/*  w  ww .  j av  a 2 s . c o  m*/
                continue;
            }
            int j = 0;
            for (; j < sortList.size(); j++) {
                String sortStr = sortList.get(j);
                if (str.compareTo(sortStr) <= 0) {
                    sortList.add(j, str);
                    break;
                }
            }
            if (j == sortList.size()) {
                sortList.add(str);
            }
        }
    }
    return sortList;
}

From source file:org.axe.util.StringUtil.java

/**
 * ??//from w  w  w  . j a  v a 2s  .co m
 */
public static List<String> sortStringSet(Set<String> stringSet) {
    LinkedList<String> sortList = new LinkedList<>();
    if (stringSet != null && stringSet.size() > 0) {
        for (String str : stringSet) {
            if (sortList.size() == 0) {
                sortList.add(str);
                continue;
            }

            int j = 0;
            for (; j < sortList.size(); j++) {
                String sortStr = sortList.get(j);
                if (str.compareTo(sortStr) <= 0) {
                    sortList.add(j, str);
                    break;
                }
            }
            if (j == sortList.size()) {
                sortList.add(str);
            }
        }
    }
    return sortList;
}

From source file:com.k42b3.aletheia.protocol.http.Util.java

public static String buildMessage(String statusLine, LinkedList<Header> header, String body, String delimter) {
    StringBuilder str = new StringBuilder();

    // status line
    str.append(statusLine);/*from   w  ww .  jav a2  s. c o m*/
    str.append(delimter);

    // headers
    for (int i = 0; i < header.size(); i++) {
        str.append(header.get(i).getName() + ": " + header.get(i).getValue() + delimter);
    }

    str.append(delimter);

    // body
    if (body != null && !body.isEmpty()) {
        str.append(body);
    }

    return str.toString();
}

From source file:org.zywx.wbpalmstar.plugin.uexiconlist.utils.IconListUtils.java

public static String getJsonStrFromIconList(LinkedList<IconBean> list) {
    JSONArray jsonArry = new JSONArray();
    JSONObject json = new JSONObject();
    try {/*from   w  w  w . j ava  2 s . c om*/
        for (int i = 0; i < list.size(); i++) {
            jsonArry.put(i, getJsonFromIcon(list.get(i)));
        }
        json.put(JK_LIST_ITEM, jsonArry);
    } catch (JSONException e) {
        e.printStackTrace();
    }
    return json.toString();
}

From source file:msearch.filmeSuchen.sender.MediathekReader.java

static void listeSort(LinkedList<String[]> liste, int stelle) {
    //Stringliste alphabetisch sortieren
    GermanStringSorter sorter = GermanStringSorter.getInstance();
    if (liste != null) {
        String str1;/*from www  .  ja v a2  s  .c  om*/
        String str2;
        for (int i = 1; i < liste.size(); ++i) {
            for (int k = i; k > 0; --k) {
                str1 = liste.get(k - 1)[stelle];
                str2 = liste.get(k)[stelle];
                // if (str1.compareToIgnoreCase(str2) > 0) {
                if (sorter.compare(str1, str2) > 0) {
                    liste.add(k - 1, liste.remove(k));
                } else {
                    break;
                }
            }
        }
    }
}

From source file:com.arman.efficientqhalgoforch.SuperAwesomeCardFragment.java

public static float[] DtoFloat(LinkedList<Double> d) {
    float[] floatArray = new float[d.size() + 1];
    for (int i = 0; i < floatArray.length; i++) {
        floatArray[i] = (float) (d.get(i) / 1.0);
    }/*from   ww  w. ja  v a 2  s  . c  om*/
    return floatArray;
}

From source file:com.arman.efficientqhalgoforch.SuperAwesomeCardFragment.java

public static String[] DtoString(LinkedList<Double> d) {
    String[] s = new String[d.size() + 1];
    s[0] = "";//from w  ww.  j  a v a 2 s  .c  o m
    for (int i = 1, j = 0; i < s.length; i++, j++)
        s[i] = String.valueOf(d.get(j));

    return s;
}