Java List Reverse reverseCopy(Iterable list)

Here you can find the source of reverseCopy(Iterable list)

Description

reverse Copy

License

Apache License

Declaration

public static <T> ArrayList<T> reverseCopy(Iterable<T> list) 

Method Source Code

//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;
    }
}

Related

  1. reverse(List list)
  2. reverse(List list)
  3. reverse(List src, List dst)
  4. reverse(List xs)
  5. reverse(List l)
  6. reverseCopy(List list)
  7. reverseCopy(List original)
  8. reversed(final List list)
  9. reversed(List l)