Package java.math

Examples of java.math.BigInteger.longValue()


        BigInteger tripPatternStopId = (BigInteger)idQuery.getSingleResult();

        q = em.createNativeQuery("INSERT INTO trippatternstop (id, pattern_id, stop_id, stopsequence, defaultdwelltime, defaultdistance, defaulttraveltime)" +
        "  VALUES(?, ?, ?, ?, ?, ?, ?);");

        q.setParameter(1,  tripPatternStopId.longValue());
        q.setParameter(2,  tripPatternId.longValue());
        q.setParameter(3,  stopTime.stop.id);
        q.setParameter(4,  stopTime.stopSequence);
        q.setParameter(5,  stopTime.departureTime - stopTime.arrivalTime);
View Full Code Here


        q.executeUpdate();
       
        q = em.createNativeQuery("INSERT INTO trippattern_trippatternstop (trippattern_id, patternstops_id) VALUES (?, ?);");
       
        q.setParameter(1,  tripPatternId.longValue());
        q.setParameter(2,  tripPatternStopId.longValue());
       
        q.executeUpdate();
       
           
           
View Full Code Here

    if (value instanceof BigInteger) {
      BigInteger big = (BigInteger) value;
      if (big.compareTo(INTEGER_MAX) < 0) {
        return big.intValue();
      } else if (big.compareTo(LONG_MAX) < 0) {
        return big.longValue();
      }
    }
    // No need to convert to float or double since those lose precision
    return value;
  }
View Full Code Here

        return getPropertyValue(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT);
    }

    public long getContentStreamLength() {
        BigInteger bigInt = getPropertyValue(PropertyIds.CONTENT_STREAM_LENGTH);
        return (bigInt == null) ? (long) -1 : bigInt.longValue();
    }

    public String getContentStreamMimeType() {
        return getPropertyValue(PropertyIds.CONTENT_STREAM_MIME_TYPE);
    }
View Full Code Here

        {
            throw new NumberFormatException("Value \""+value+"\" lies outside the range [" + 0L + "- 2^64).");
        }
        else if(bigInt.compareTo(LONG_MAX_VALUE)>=0)
        {
            return UnsignedLong.valueOf(bigInt.longValue());
        }
        else
        {
            return UnsignedLong.valueOf(TWO_TO_THE_SIXTY_FOUR.subtract(bigInt).negate().longValue());
        }
View Full Code Here

        long acknowledgementInterval = 0;
        AcknowledgementInterval ai = rma.getAcknowledgementInterval();
        if (null != ai) {
            BigInteger val = ai.getMilliseconds();
            if (null != val) {
                acknowledgementInterval = val.longValue();
            }
        }
       
        scheduleAcknowledgement(acknowledgementInterval);
      
View Full Code Here

        long inactivityTimeout = 0;
        InactivityTimeout iat = rma.getInactivityTimeout();
        if (null != iat) {
            BigInteger val = iat.getMilliseconds();
            if (null != val) {
                inactivityTimeout = val.longValue();
            }
        }
        scheduleSequenceTermination(inactivityTimeout);
       
    }
View Full Code Here

  @Test
  public void positiveLong()
  {
    BigIntegerConverter converter = new BigIntegerConverter();
    BigInteger bigInteger = converter.convertToObject("1234567890987654321", Locale.GERMAN);
    assertEquals(1234567890987654321L, bigInteger.longValue());
  }

  @Test
  public void negativeLong()
  {
View Full Code Here

  @Test
  public void negativeLong()
  {
    BigIntegerConverter converter = new BigIntegerConverter();
    BigInteger bigInteger = converter.convertToObject("-1234567890987654321", Locale.GERMAN);
    assertEquals(-1234567890987654321L, bigInteger.longValue());
  }

  @Test
  public void positiveVeryLong()
  {
View Full Code Here

        if (intval.compareTo(_maxlong) > 0 ||
            intval.compareTo(_minlong) < 0)
            return intval.hashCode();

        long longval = intval.longValue();

        return (int)((longval >> 32) * 19 + longval);
    }

    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.