List of usage examples for java.math BigInteger longValue
public long longValue()
From source file:net.sf.jabb.util.stat.AtomicLongStatistics.java
@Override public void evaluate(BigInteger value) { long x = value.longValue(); count.incrementAndGet();//w ww .j ava 2s . co m sum.addAndGet(x); minMax.evaluate(x); }
From source file:org.openhie.openempi.model.MatchPairStat.java
public void setLeft_person_pseudo_id(java.math.BigInteger leftPersonPseudoId) { setLeftPersonPseudoId(leftPersonPseudoId.longValue()); }
From source file:dao.ModuleEventClientDao.java
public Long getCountFailsByCampaign(Long campaignId, Long pkId) { String sql = "select count(distinct mec.event_id) from module_event_client mec inner join (select event_id,max(insert_date) mid from module_event_client group by event_id) supsel left join event ev on mec.event_id=ev.event_id where mec.event_id=supsel.event_id and supsel.mid=mec.insert_date and mec.personal_cabinet_id=:pkId and ev.status=:failed and ev.campaign_id=:campaignId"; Query query = getCurrentSession().createSQLQuery(sql); query.setParameter("pkId", pkId); query.setParameter("campaignId", campaignId); query.setParameter("failed", Event.FAILED); BigInteger res = (BigInteger) query.uniqueResult(); return res.longValue(); }
From source file:service.ArticleService.java
private Long getLong(Object value) { if (value != null) { if (value instanceof Long) { return (Long) value; } else if (value instanceof BigInteger) { BigInteger bi = (BigInteger) value; return bi.longValue(); } else if (value instanceof Integer) { Integer i = (Integer) value; return i.longValue(); }//from w w w .j a v a 2 s .c om } return null; }
From source file:org.openhie.openempi.model.MatchPairStat.java
public void setRight_person_pseudo_id(java.math.BigInteger rightPersonPseudoId) { setRightPersonPseudoId(rightPersonPseudoId.longValue()); }
From source file:org.apache.taverna.scufl2.translator.t2flow.defaultdispatchstack.RetryParser.java
@Override public Configuration parseConfiguration(T2FlowParser t2FlowParser, ConfigBean configBean, ParserState parserState) throws ReaderException { RetryConfig config = unmarshallConfig(t2FlowParser, configBean, "xstream", RetryConfig.class); Configuration c = new Configuration(); c.setType(scufl2Uri.resolve("#Config")); ObjectNode json = (ObjectNode) c.getJson(); BigInteger maxRetries = config.getMaxRetries(); if (maxRetries != null && (maxRetries.longValue() != MAX_RETRIES || maxRetries.longValue() < 0)) json.put("maxRetries", maxRetries.longValue()); if (maxRetries != null && maxRetries.longValue() != 0) { // Neither of these makes sense if retries are disabled if (config.getInitialDelay() != INITIAL_DELAY && config.getInitialDelay() > -1) json.put("initialDelay", config.getInitialDelay()); if (config.getMaxDelay() != MAX_DELAY && config.getMaxDelay() > -1) json.put("maxDelay", config.getMaxDelay()); double delta = Math.abs(config.getBackoffFactor() - BACKOFF_FACTOR); if (config.getBackoffFactor() > 0 && delta > 1e-14) json.put("backoffFactor", config.getBackoffFactor()); }//from w w w .j a v a 2s .co m return c; }
From source file:org.softdays.mandy.AbstractDbSetupTest.java
public Long getValueAsLong(final ITable table, final int rowIndex, final String column) { try {/*from www . j av a2 s . c om*/ final BigInteger bigInt = (BigInteger) table.getValue(rowIndex, column); return Long.valueOf(bigInt.longValue()); } catch (final DataSetException e) { Assert.fail(e.getMessage()); } return null; }
From source file:com.doculibre.constellio.services.FeaturedLinkServicesImpl.java
@Override public FeaturedLink suggest(String text, RecordCollection collection) { FeaturedLink suggestion;/*from ww w.java 2 s. c o m*/ EntityManager entityManager = ConstellioPersistenceContext.getCurrentEntityManager(); String analyzedText; try { analyzedText = AnalyzerUtils.analyze(text, collection); } catch (Exception e) { analyzedText = null; } if (StringUtils.isNotBlank(analyzedText)) { StringBuffer sql = new StringBuffer(); sql.append("SELECT FL.id FROM FeaturedLink FL, FeaturedLink_KeywordsAnalyzed FLK, RecordCollection RC"); sql.append(" WHERE FLK.FeaturedLink_id=FL.id AND FL.RecordCollection_id=RC.id"); sql.append(" AND RC.id=? AND FLK.keyword=?"); Query sqlQuery = entityManager.createNativeQuery(sql.toString()); sqlQuery.setMaxResults(1); sqlQuery.setParameter(1, collection.getId()); sqlQuery.setParameter(2, analyzedText); try { BigInteger featuredLinkId = (BigInteger) sqlQuery.getSingleResult(); suggestion = get(featuredLinkId.longValue()); } catch (NoResultException e) { suggestion = null; } } else { suggestion = null; } return suggestion; }
From source file:br.com.jbugbrasil.bot.service.packt.notifier.PacktNotifier.java
private void notify(BigInteger chatId) { Chat chat = new Chat(); chat.setId(chatId.longValue()); Message message = new Message(); message.setChat(chat);/* ww w . ja v a2s . c om*/ message.setText(this.get()); messageSender.processOutgoingMessage(message); }
From source file:net.ripe.ipresource.Ipv4Address.java
@Deprecated public Ipv4Address(BigInteger value) { this(value.longValue()); }