Java List Prepend prepend(String clang, List args)

Here you can find the source of prepend(String clang, List args)

Description

prepend

License

Open Source License

Declaration

private static List<String> prepend(String clang, List<String> args) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {
    private static List<String> prepend(String clang, List<String> args) {
        try {//from  w  w  w  .  j av  a2s  . c  om
            args.add(0, clang);
            return args;
        } catch (Exception e) {
            ArrayList<String> commands = new ArrayList<String>(args.size() + 1);
            commands.add(clang);
            commands.addAll(args);
            return commands;
        }
    }
}

Related

  1. prepend(final List list, final int numElements, final T element)
  2. prepend(final List suffix, final T... values)
  3. prepend(final T value, final List list)
  4. prepend(List list, E e)
  5. prepend(List list, int minCapacity, E... items)
  6. prepend(String prefix, List strings)
  7. prepend(String start, List suggestions)
  8. prependInList(T el, T[] array)
  9. prependToList(A elem, List list)