Here you can find the source of reverseCopy(Iterable
public static <T> ArrayList<T> reverseCopy(Iterable<T> list)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { public static <T> ArrayList<T> reverseCopy(Iterable<T> list) { ArrayList<T> result = new ArrayList<T>(); for (T item : list) { result.add(0, item);//w w w . j a v a2 s . c om } return result; } public static double[] add(double[] v1, double[] v2) { double[] sumv = new double[v1.length]; for (int i = 0; i < v1.length; i++) sumv[i] = v1[i] + v2[i]; return sumv; } public static double[] add(double[] v1, int[] v2) { double[] sumv = new double[v1.length]; for (int i = 0; i < v1.length; i++) sumv[i] = v1[i] + v2[i]; return sumv; } public static double[] add(double[] v1, double x) { double[] sumv = new double[v1.length]; for (int i = 0; i < v1.length; i++) sumv[i] = v1[i] + x; return sumv; } }