Java List Add put(List list, int[] values)

Here you can find the source of put(List list, int[] values)

Description

put

License

Open Source License

Declaration

public static void put(List<Integer> list, int[] values) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static void put(List<Integer> list, int[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);// w  ww  . j a  v  a  2  s.  c  o  m
        }
    }

    public static void put(List<Float> list, float[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);
        }
    }

    public static void put(List<Double> list, double[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);
        }
    }

    public static void put(List<Long> list, long[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);
        }
    }

    public static void put(List<Short> list, short[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);
        }
    }

    public static void put(List<Byte> list, byte[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);
        }
    }

    public static void put(List<String> list, String[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);
        }
    }

    public static void put(List list, Object[] values) {
        if (list == null || values == null)
            return;
        for (int i = 0; i < values.length; i++) {
            list.add(values[i]);
        }
    }
}

Related

  1. put(List list, Object object)
  2. put(Map> multiValueMap, String key, Object value, boolean single)

  3. HOME | Copyright © www.java2s.com 2016