List of usage examples for java.lang Integer intValue
@HotSpotIntrinsicCandidate public int intValue()
From source file:com.tesora.dve.sql.statement.dml.AliasInformation.java
public int getAliasCount(UnqualifiedName unq) { String n = unq.get();/*from w w w . j ava2s. c om*/ Integer count = aliases.get(n); return (count == null ? 0 : count.intValue()); }
From source file:misc.TrackFocusDemo.java
public TrackFocusDemo() { super(new BorderLayout()); JPanel mugshots = new JPanel(new GridLayout(2, 3)); pic1 = new Picture(createImageIcon("images/" + mayaString + ".jpg", mayaString).getImage()); pic1.setName("1"); mugshots.add(pic1);//from w w w . j a v a 2 s .co m pic2 = new Picture(createImageIcon("images/" + anyaString + ".jpg", anyaString).getImage()); pic2.setName("2"); mugshots.add(pic2); pic3 = new Picture(createImageIcon("images/" + laineString + ".jpg", laineString).getImage()); pic3.setName("3"); mugshots.add(pic3); pic4 = new Picture(createImageIcon("images/" + cosmoString + ".jpg", cosmoString).getImage()); pic4.setName("4"); mugshots.add(pic4); pic5 = new Picture(createImageIcon("images/" + adeleString + ".jpg", adeleString).getImage()); pic5.setName("5"); mugshots.add(pic5); pic6 = new Picture(createImageIcon("images/" + alexiString + ".jpg", alexiString).getImage()); pic6.setName("6"); mugshots.add(pic6); info = new JLabel("Nothing selected"); setPreferredSize(new Dimension(450, 350)); add(mugshots, BorderLayout.CENTER); add(info, BorderLayout.PAGE_END); setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); focusManager.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (("focusOwner".equals(prop)) && ((e.getNewValue()) instanceof Picture)) { Component comp = (Component) e.getNewValue(); String name = comp.getName(); Integer num = new Integer(name); int index = num.intValue(); if (index < 0 || index > comments.length) { index = 0; } info.setText(comments[index]); } } }); }
From source file:com.surfs.storage.web.controller.monitor.DiskController.java
@RequestMapping(value = "/showDisk.do") public ModelAndView showDiskInfos() { LogFactory.info("call showDiskInfos!"); Map<String, Integer> diskCount = new HashMap<>(); Map<String, Map<String, Map<String, Disk>>> mapDisks = diskService.getDiskInfos(); for (Entry<String, Map<String, Map<String, Disk>>> mapmapmap : mapDisks.entrySet()) { Map<String, Map<String, Disk>> mapmap = mapmapmap.getValue(); for (Entry<String, Map<String, Disk>> map : mapmap.entrySet()) { Map<String, Disk> m = map.getValue(); for (Entry<String, Disk> md : m.entrySet()) { Disk disk = md.getValue(); if (diskCount.containsKey(disk.getStatus())) { Integer num = diskCount.get(disk.getStatus()); diskCount.put(disk.getStatus(), num.intValue() + 1); } else { diskCount.put(disk.getStatus(), 1); }// w w w . j av a 2 s.c o m } } } if (!diskCount.containsKey("FREE")) diskCount.put("FREE", 0); if (!diskCount.containsKey("USED")) diskCount.put("USED", 0); if (!diskCount.containsKey("FAIL")) diskCount.put("FAIL", 0); ModelAndView mav = new ModelAndView("monitor/disk", "mapDisks", diskService.getDiskInfos()); mav.addObject("diskCount", diskCount); return mav; }
From source file:net.turnbig.jdbcx.test.JdbcxServiceTest.java
@Test public void testCountByField() { Integer count = memberService.countByFields(FieldValue.of("id", 1), FieldValue.of("regist_ip", "127.0.0.1")); Assert.assertEquals(count.intValue(), 1); Integer count2 = memberService.countByFields(FieldValue.of("id", 0), FieldValue.of("regist_ip", "127.0.0.1")); Assert.assertEquals(count2.intValue(), 0); }
From source file:org.netxilia.spi.impl.storage.db.ddl.schema.DbColumn.java
/** Has no effect if column's type has fixed size. However, the value is recorded. */ public void setSize(Integer size) { Assert.isTrue((size == null) || (size.intValue() > 0), "Column size must be > 0"); this.size = size; }
From source file:com.seajas.search.codex.social.connection.InMemoryProviderConnectionRepository.java
protected int getNextRank() { Integer maxRank = null;/*from ww w . ja va2s . c o m*/ for (Integer rank : connectionDataByRank.keySet()) { if (maxRank == null || rank.intValue() > maxRank.intValue()) { maxRank = rank.intValue(); } } return maxRank == null ? 1 : (maxRank.intValue() + 1); }
From source file:edu.psu.citeseerx.misc.charts.CiteChartBuilderJFree.java
private XYDataset collectData(java.util.List<ThinDoc> docs) { Calendar now = Calendar.getInstance(); int currentYear = now.get(Calendar.YEAR); HashMap<Integer, DataPoint> data = new HashMap<Integer, DataPoint>(); for (ThinDoc doc : docs) { try {//from w w w. j a v a2 s. c o m Integer year = new Integer(doc.getYear()); if (year.intValue() < 1930 || year.intValue() > currentYear + 2) { continue; } DataPoint point; if (data.containsKey(year)) { point = data.get(year); } else { point = new DataPoint(year.intValue()); data.put(year, point); } point.ncites++; } catch (Exception e) { } } XYSeries series = new XYSeries("Years"); for (DataPoint point : data.values()) { System.out.println(point.year); System.out.println(point.ncites); series.add(point.year, point.ncites); } XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(series); return dataset; }
From source file:org.netxilia.spi.impl.storage.db.ddl.schema.DbColumn.java
/** Has no effect if column's type has fixed size. However, the value is recorded. */ public void setScale(Integer scale) { Assert.isTrue((scale == null) || (scale.intValue() > 0), "Column scale must be > 0"); this.scale = scale; }
From source file:com.hs.mail.imap.mailbox.SelectedMailbox.java
/** * Get the message sequence number corresponding to the given UID from the * cache. If not exist, <code>-1</code> is returned. *///ww w . ja v a 2 s.com public int getMessageNumber(long uid) { Integer v = (Integer) converter.getKey(uid); return (v != null) ? v.intValue() : -1; }
From source file:geneaquilt.algorithms.LayerClusterer.java
private void assignRank(V v, int vRank) { for (V child : graph.getPredecessors(v)) { Integer o = rank.get(child); int newRank; if (o != null) { int oldRank = o.intValue(); newRank = Math.max(oldRank, vRank + 1); } else/*from w w w .j a v a 2 s . co m*/ newRank = vRank + 1; rank.put(child, new Integer(newRank)); if (newRank > maxRank) maxRank = newRank; assignRank(child, newRank); } }