List of usage examples for java.lang Integer Integer
@Deprecated(since = "9") public Integer(String s) throws NumberFormatException
From source file:com.redhat.lightblue.crud.validator.MinMaxCheckerTest.java
/** * Col1: For debugging purposes to know which test case had issues * Col2: A instantiation to test with. Should always represent 2. *///ww w . j a v a 2s. co m @Parameters(name = "{index}: {0}") public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { Integer.class, new Integer(2) }, { Byte.class, new Byte(new Integer(2).byteValue()) }, { Short.class, new Short(new Integer(2).shortValue()) }, { Long.class, new Long(2L) }, { Float.class, new Float(2F) }, { Double.class, new Double(2D) }, { BigInteger.class, new BigInteger("2") }, { BigDecimal.class, new BigDecimal(2) } }); }
From source file:CollectionTest.java
static void doTest(List l) { Integer n = new Integer(0); for (int i = 0; i < nLoops; i++) l.add(n); }
From source file:rzd.vivc.documentexamination.repository.UserRepositoryImpl.java
@Override public int getTotalCount() { return new Integer(em.createQuery("SELECT COUNT(u) FROM User u").getSingleResult().toString()); }
From source file:ChoiceFormatDemo.java
static void displayMessages(Locale currentLocale) { System.out.println("currentLocale = " + currentLocale.toString()); System.out.println();/*from ww w . j ava 2 s . c o m*/ ResourceBundle bundle = ResourceBundle.getBundle("ChoiceBundle", currentLocale); MessageFormat messageForm = new MessageFormat(""); messageForm.setLocale(currentLocale); double[] fileLimits = { 0, 1, 2 }; String[] fileStrings = { bundle.getString("noFiles"), bundle.getString("oneFile"), bundle.getString("multipleFiles") }; ChoiceFormat choiceForm = new ChoiceFormat(fileLimits, fileStrings); String pattern = bundle.getString("pattern"); Format[] formats = { choiceForm, null, NumberFormat.getInstance() }; messageForm.applyPattern(pattern); messageForm.setFormats(formats); Object[] messageArguments = { null, "XDisk", null }; for (int numFiles = 0; numFiles < 4; numFiles++) { messageArguments[0] = new Integer(numFiles); messageArguments[2] = new Integer(numFiles); String result = messageForm.format(messageArguments); System.out.println(result); } }
From source file:com.jaspersoft.studio.editor.preview.input.array.number.IntegerElement.java
@Override protected Object convertString(String str) { return new Integer(str); }
From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.IntegerCalculator.java
public Object add(Object obj1, Object obj2) { Integer intData1 = (Integer) obj1; Integer intData2 = (Integer) obj2; return (Object) (new Integer((int) (intData1.intValue() + intData2.intValue()))); }
From source file:Main.java
public void run() { try {//w w w.j a v a2s . c o m int N = 0; while (true) { Data.mutex.acquire(); Data.list.add(new Integer(N++)); Data.mutex.release(); Data.sem.release(1); Thread.sleep(500); } } catch (Exception x) { x.printStackTrace(); } }
From source file:io.getlime.security.powerauth.app.server.repository.model.ActivationStatusConverter.java
@Override public Integer convertToDatabaseColumn(ActivationStatus status) { return new Integer(status.getByte()); }
From source file:module.siadap.domain.wrappers.SiadapYearWrapper.java
public static SiadapYearWrapper getCurrentYearOrLatestAvailableWrapper() { SiadapYearWrapper siadapYearWrapper = null; ArrayList<Integer> yearsWithConfigs = SiadapYearsFromExistingSiadapConfigurations .getYearsWithExistingConfigs(); if (yearsWithConfigs.contains(new Integer(new LocalDate().getYear()))) { int year = new LocalDate().getYear(); siadapYearWrapper = new SiadapYearWrapper(year); } else {//from www. j a v a2 s . c o m siadapYearWrapper = new SiadapYearWrapper(yearsWithConfigs.get(yearsWithConfigs.size() - 1)); } return siadapYearWrapper; }
From source file:com.oracle2hsqldb.dialect.GenericDialect.java
private static void registerType(String typeName, int type) { Integer objectType = new Integer(type); TYPES_BY_NAME.put(typeName, objectType); TYPES_BY_TYPE.put(objectType, typeName); }