Here you can find the source of toList(final int[] array)
Parameter | Description |
---|---|
array | a parameter |
public static List<Integer> toList(final int[] array)
//package com.java2s; /******************************************************************************* * Manchester Centre for Integrative Systems Biology * University of Manchester/*from w w w. j a va 2 s. c o m*/ * Manchester M1 7ND * United Kingdom * * Copyright (C) 2007 University of Manchester * * This program is released under the Academic Free License ("AFL") v3.0. * (http://www.opensource.org/licenses/academic.php) *******************************************************************************/ import java.util.*; public class Main { /** * * @param array * @return List<Integer> */ public static List<Integer> toList(final int[] array) { final List<Integer> list = new ArrayList<>(); for (final int value : array) { list.add(Integer.valueOf(value)); } return list; } /** * * @param array * @return List<Double> */ public static List<Double> toList(final double[] array) { final List<Double> list = new ArrayList<>(); for (final double value : array) { list.add(Double.valueOf(value)); } return list; } }