Package java.math

Examples of java.math.BigInteger.shortValue()


        return values.get(index);
      case SUM:
        BigInteger sum = BigInteger.valueOf(0);
        for (int i = 0; i < values.size(); ++i)
          sum = sum.add(BigInteger.valueOf(values.get(i)));
        return sum.shortValue();
      case MIN:
        BigInteger minimum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (minimum.compareTo(BigInteger.valueOf(
              values.get(i))) > 0)
View Full Code Here


        BigInteger minimum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (minimum.compareTo(BigInteger.valueOf(
              values.get(i))) > 0)
            minimum = BigInteger.valueOf(values.get(i));
        return minimum.shortValue();
      case MAX:
        BigInteger maximum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (maximum.compareTo(BigInteger.valueOf(
              values.get(i))) < 0)
View Full Code Here

        BigInteger maximum = BigInteger.valueOf(values.get(0));
        for (int i = 1; i < values.size(); ++i)
          if (maximum.compareTo(BigInteger.valueOf(
              values.get(i))) < 0)
            maximum = BigInteger.valueOf(values.get(i));
        return maximum.shortValue();
      case FIRST:
        return values.get(0);
      case LAST:
        return values.get(values.size() - 1);
      default:
View Full Code Here

                    if ( gt > 0 || lt < 0 )
                    {
                        throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
                                                PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
                    }
                    return i.shortValue();

                }
                catch ( NumberFormatException ne )
                {
                    throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
View Full Code Here

    catch (Exception e) {
      harness.debug(e);
    }
    harness.check(b1.equals(b2));
    harness.check(b1.byteValue() == b2.byteValue());
    harness.check(b1.shortValue() == b2.shortValue());
    harness.check(b1.intValue() == b2.intValue());
    harness.check(b1.longValue() == b2.longValue())// see bug parade 4823171
    harness.check(b1.floatValue() == b2.floatValue());
    harness.check(b1.doubleValue() == b2.doubleValue());
  }
View Full Code Here

                    if ( gt > 0 || lt < 0 )
                    {
                        throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
                                                PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
                    }
                    return i.shortValue();

                }
                catch ( NumberFormatException ne )
                {
                    throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
View Full Code Here

                    if ( gt > 0 || lt < 0 )
                    {
                        throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
                                                PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
                    }
                    return i.shortValue();

                }
                catch ( NumberFormatException ne )
                {
                    throw new PSQLException(GT.tr("Bad value for type {0} : {1}", new Object[]{"short",s}),
View Full Code Here

       
        if (size == Byte.SIZE) {
          dos.writeByte(number.byteValue());
          bytesWritten += Byte.SIZE / 8;
        } else if (size == Short.SIZE) {
          dos.writeShort(number.shortValue());
          bytesWritten += Short.SIZE / 8;
        } else if (size == Integer.SIZE) {
          dos.writeInt(number.intValue());
          bytesWritten += Integer.SIZE / 8;
        } else if (size == Long.SIZE) {
View Full Code Here

        Integer size = entry.getValue();
       
        if (size == Byte.SIZE) {
          assertEquals(number.byteValue(), bs.readBits(size, true).byteValue());
        } else if (size == Short.SIZE) {
          assertEquals(number.shortValue(), bs.readBits(size, true).shortValue());
        } else if (size == Integer.SIZE) {
          assertEquals(number.intValue(), bs.readBits(size, true).intValue());
        } else if (size == Long.SIZE) {
          assertEquals(number.longValue(), bs.readBits(size, true).longValue());
        }
View Full Code Here

        Integer size = entry.getValue();
       
        if (size == Byte.SIZE) {
          assertEquals(number.byteValue(), dis.readByte());
        } else if (size == Short.SIZE) {
          assertEquals(number.shortValue(), dis.readShort());
        } else if (size == Integer.SIZE) {
          assertEquals(number.intValue(), dis.readInt());
        } else if (size == Long.SIZE) {
          assertEquals(number.longValue(), dis.readLong());
        }
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.