Java List First Item moveItemKindInFirst(final List list)

Here you can find the source of moveItemKindInFirst(final List list)

Description

move Item Kind In First

License

Open Source License

Declaration

private static boolean moveItemKindInFirst(final List<String> list) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2013 Jens Kristian Villadsen.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html/* w w w  .ja  v  a  2s. c o m*/
 * 
 * Contributors:
 *     Jens Kristian Villadsen - Lead developer, owner and creator
 ******************************************************************************/

import java.util.List;

public class Main {
    private static boolean moveItemKindInFirst(final List<String> list) {
        boolean noItemKind = true;
        if (list.contains("dmap.itemkind")) {
            list.remove("dmap.itemkind");
            list.add(0, "dmap.itemkind");
            noItemKind = false;
        }
        return noItemKind;
    }
}

Related

  1. listWith(Object aFirstObject)
  2. merge(List first, List second)
  3. mergeLists(List first, List second)
  4. mergeLists(List first, List second)
  5. mergePreserveOrder(List first, List second)
  6. nullSafeAppend(List first, List second)
  7. orderByFirstOccurenceInText(String listToOrder[], String textToParse, boolean fuzzy)
  8. orderByFuzzyFirstOccurenceInText(String listToOrder[], String textToParse)
  9. permutationsWithFirstElement(List listings)