Example usage for java.lang Integer intValue

List of usage examples for java.lang Integer intValue

Introduction

In this page you can find the example usage for java.lang Integer intValue.

Prototype

@HotSpotIntrinsicCandidate
public int intValue() 

Source Link

Document

Returns the value of this Integer as an int .

Usage

From source file:Main.java

private static int buildUpdateFrequency(Integer frequency) {
    if (frequency != null) {
        return frequency.intValue() * 1000;
    } else {//from  ww w  .j  a v a2s .  c o  m
        return DEFAULT_UPDATE_FREQUENCY;
    }
}

From source file:Main.java

@SuppressWarnings("checkstyle:magicnumber")
private static int decodeColor(String colorString) {
    final Integer intval = Integer.decode(colorString);
    return intval.intValue();
}

From source file:Main.java

public static void setFrameColor(View view, Integer integer) {
    if (integer != null) {
        view.setBackgroundColor(integer.intValue());
    }/*from   w w w .  j a  va 2  s .  c o  m*/
}

From source file:Main.java

public static int nullAs(Integer integer, int i) {
    if (integer != null)
        i = integer.intValue();
    return i;/*w ww.  j  a  v a  2 s. co m*/
}

From source file:Main.java

private static final <T> int getFreq(final T obj, final Map<T, Integer> freqMap) {
    Integer count = freqMap.get(obj);
    if (count != null) {
        return count.intValue();
    }/*from   w ww .  j  a va2 s .c  o m*/
    return 0;
}

From source file:Main.java

static public int getServiceChannel(Class<?> btClass, ParcelUuid uuid) throws Exception {
    Method getServiceChannelMethod = btClass.getMethod("getServiceChannel");
    Integer returnValue = (Integer) getServiceChannelMethod.invoke(uuid);
    return returnValue.intValue();
}

From source file:Main.java

public static int getCurrentPage(String key) {
    int currentPage = 1;
    Integer v = hmPages.get(key);
    if (v != null) {
        currentPage = v.intValue();
    }//from w  ww  .  j  av  a  2 s  . c om
    return currentPage;
}

From source file:Main.java

/**
 * unbox Integer/*  ww w  . j av  a  2 s .  c o m*/
 */
public static int unboxed(Integer v) {
    return v == null ? 0 : v.intValue();
}

From source file:Main.java

public static int[] toIntArray(Collection<Integer> items) {
    int ret[] = new int[items.size()];
    int idx = 0;//w w  w .j a  va  2s  . c  o m
    for (Integer i : items) {
        assert (i != null);
        ret[idx++] = i.intValue();
    } // FOR
    return (ret);
}

From source file:Main.java

public static CharSequence getJellyBeanFix(CharSequence input) {
    ArrayList<Integer> resultList = new ArrayList<Integer>();

    for (int i = 0; i < input.length(); i++) {
        int iValue = (int) input.charAt(i);
        if (iValue == 0x1031) {
            resultList.add(JBFIX_CHAR);// ww w.j a v  a 2  s  .c o  m
            resultList.add(iValue);
        } else if (iValue == 0x1039) {
            resultList.add(iValue);
            resultList.add(JBFIX_CHAR);
        } else {
            resultList.add(iValue);
        }
    }

    char[] chArray = new char[resultList.size()];
    int count = 0;
    for (Integer ch : resultList) {
        chArray[count++] = (char) ch.intValue();
    }

    return String.valueOf(chArray);
}