List of usage examples for java.lang Integer intValue
@HotSpotIntrinsicCandidate public int intValue()
From source file:Main.java
public static Integer P1(Integer x) throws Exception { return Integer.valueOf( x.intValue() ^ Integer.rotateLeft(x.intValue(), 15) ^ Integer.rotateLeft(x.intValue(), 23)); }
From source file:Main.java
public static Integer P0(Integer x) throws Exception { return Integer .valueOf(x.intValue() ^ Integer.rotateLeft(x.intValue(), 9) ^ Integer.rotateLeft(x.intValue(), 17)); }
From source file:edu.tamu.tcat.oss.account.test.mock.MockDataSource.java
private static int getIntValue(ConfigurationProperties props, String prop, int defaultValue) { Integer d = Integer.valueOf(defaultValue); Integer result = props.getPropertyValue(prop, Integer.class, d); return result.intValue(); }
From source file:Main.java
public static <T> Map<T, Integer> getCardinalityMap(final Collection<T> coll) { if (coll == null) { return null; }/* w ww. j av a 2 s . co m*/ Map<T, Integer> result = new HashMap<T, Integer>(); Iterator<T> it = coll.iterator(); while (it.hasNext()) { T t = it.next(); Integer count = result.get(t); if (count == null) { result.put(t, ONE); } else { result.put(t, new Integer(count.intValue() + 1)); } } return result; }
From source file:jef.testbase.JefTester.java
private static void sampleAdd(Map<Integer, Integer> data, BufferedReader r) throws IOException { String line;/*from www.j av a2s .c om*/ while ((line = r.readLine()) != null) { for (char c : line.toCharArray()) { total++; Integer i = (int) c; if (!CharUtils.isAscii((char) i.intValue())) { totalStat++; if (data.containsKey(i)) { data.put(i, data.get(i) + 1); } else { data.put(i, 1); } } } } }
From source file:Main.java
public static void add(Map<String, Integer> statMap, String key) { Integer counter = statMap.get(key); if (counter == null) { statMap.put(key, Integer.valueOf(1)); } else {/*from w w w. j av a 2 s .c om*/ statMap.put(key, Integer.valueOf(counter.intValue() + 1)); } }
From source file:ThreadDemo.java
/** This is the dummy method our threads all call */ static synchronized void compute() { // Figure out how many times we've been called by the current thread Integer n = (Integer) numcalls.get(); if (n == null) n = new Integer(1); else//from w ww. j a v a 2s. c o m n = new Integer(n.intValue() + 1); numcalls.set(n); // Display the name of the thread, and the number of times called System.out.println(Thread.currentThread().getName() + ": " + n); // Do a long computation, simulating a "compute-bound" thread for (int i = 0, j = 0; i < 1000000; i++) j += i; // Alternatively, we can simulate a thread subject to network or I/O // delays by causing it to sleep for a random amount of time: try { // Stop running for a random number of milliseconds Thread.sleep((int) (Math.random() * 100 + 1)); } catch (InterruptedException e) { } // Each thread politely offers the other threads a chance to run. // This is important so that a compute-bound thread does not "starve" // other threads of equal priority. Thread.yield(); }
From source file:Main.java
public static BigDecimal calculatePercent(Integer numerator, Integer denominator) { BigDecimal result = BigDecimal.ZERO; if (numerator != null && denominator != null) { return calculatePercent(new BigDecimal(numerator.intValue()), new BigDecimal(denominator.intValue())); }/* www . j a v a2s . c o m*/ return result; }
From source file:com.l2jfree.gameserver.instancemanager.RaidPointsManager.java
public static int calculateRanking(int playerObjId) { Integer value = getRankList().get(playerObjId); return value == null ? 0 : value.intValue(); }
From source file:Main.java
@SuppressWarnings({ "rawtypes", "unchecked" }) public static Map getCardinalityMap(final Collection coll) { Map count = new HashMap(); for (Iterator it = coll.iterator(); it.hasNext();) { Object obj = it.next();/*from ww w .ja v a2 s . c o m*/ Integer c = (Integer) (count.get(obj)); if (c == null) { count.put(obj, INTEGER_ONE); } else { count.put(obj, new Integer(c.intValue() + 1)); } } return count; }