Java Object to int castToInts(final double[] doubles)

Here you can find the source of castToInts(final double[] doubles)

Description

cast To Ints

License

Open Source License

Declaration

public static int[] castToInts(final double[] doubles) 

Method Source Code

//package com.java2s;

public class Main {
    public static int[] castToInts(final double[] doubles) {
        final int[] ints = new int[doubles.length];
        for (int i = 0; i < doubles.length; ++i)
            ints[i] = (int) doubles[i];
        return ints;
    }/*from  w  w w  .  ja  v  a 2  s  .  c  o  m*/

    public static int[][] castToInts(final double[][] doubles) {
        final int[][] ints = new int[doubles.length][];
        for (int l = 0; l < doubles.length; ++l)
            ints[l] = castToInts(doubles[l]);
        return ints;
    }
}

Related

  1. castToInt(Object value)
  2. castToInteger(final String uid)
  3. castToInteger(Object object)
  4. castToInteger(Object value)
  5. castToIntegerArray(Object[] array)
  6. objToInt(Object obj)
  7. objToInteger(Object obj)