Java Integer Create toInt(double[] v)

Here you can find the source of toInt(double[] v)

Description

to Int

License

Open Source License

Declaration

public static int[] toInt(double[] v) 

Method Source Code

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

public class Main {
    public static int[] toInt(double[] v) {
        final int[] ans = new int[v.length];
        for (int k = 0; k < v.length; k++)
            ans[k] = (int) v[k];
        return (ans);
    }/*w ww  .j  a  va2  s  . c o m*/

    public static int[] toInt(float[] v) {
        final int[] ans = new int[v.length];
        for (int k = 0; k < v.length; k++)
            ans[k] = (int) v[k];
        return (ans);
    }

    public static int[] toInt(long[] v) {
        final int[] ans = new int[v.length];
        for (int k = 0; k < v.length; k++)
            ans[k] = (int) v[k];
        return (ans);
    }

    public static int[][] toInt(float[][] v) {
        final int[][] ans = new int[v.length][];
        for (int k = 0; k < v.length; k++)
            ans[k] = toInt(v[k]);
        return (ans);
    }

    public static int[][] toInt(double[][] v) {
        final int[][] ans = new int[v.length][];
        for (int k = 0; k < v.length; k++)
            ans[k] = toInt(v[k]);
        return (ans);
    }

    public static int[][] toInt(long[][] v) {
        final int[][] ans = new int[v.length][];
        for (int k = 0; k < v.length; k++)
            ans[k] = toInt(v[k]);
        return (ans);
    }
}

Related

  1. toInt(double val)
  2. toInt(double value)
  3. toInt(double[] arr)
  4. toInt(double[] array)
  5. toInt(double[] layer)
  6. toInt(double[][] data)
  7. toInt(double[][] doubles)
  8. toInt(final Boolean value)
  9. toInt(final byte b)