Java Integer Create toInt(T[] v)

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

Description

to Int

License

Apache License

Declaration

public static <T> int[] toInt(T[] v) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static <T> int[] toInt(T[] v) {
        if (v == null)
            return null;
        int[] newv = new int[v.length];
        for (int i = 0; i < v.length; i++)
            newv[i] = ((Integer) v[i]);
        return newv;
    }//from w  w  w.j  a va2  s . com

    public static int[] toInt(boolean[] v) {
        int[] newv = new int[v.length];
        for (int i = 0; i < v.length; i++)
            newv[i] = v[i] ? 1 : 0;
        return newv;
    }
}

Related

  1. toInt(String value, Integer fallback)
  2. toInt(String[] a, int off, int len)
  3. toInt(String[] s)
  4. toInt(String[] s, int i)
  5. toInt(T value)
  6. toInt24(final int value)
  7. toInt32(int[] data, int startIndex)
  8. toInt32(long x)
  9. toInt32(Object prmIntObject)