Examples of UnsignedLong


Examples of org.apache.axis2.databinding.types.UnsignedLong

                            } else if ("double".equals(attributeType)) {
                                returnObject = new Double(attribValue);
                            } else if ("decimal".equals(attributeType)) {
                                returnObject = new BigDecimal(attribValue);
                            } else if ("unsignedLong".equals(attributeType)) {
                                returnObject = new UnsignedLong(attribValue);
                            } else if ("unsignedInt".equals(attributeType)) {
                                returnObject = new UnsignedInt(attribValue);
                            } else if ("unsignedShort".equals(attributeType)) {
                                returnObject = new UnsignedShort(attribValue);
                            } else if ("unsignedByte".equals(attributeType)) {
View Full Code Here

Examples of org.apache.qpid.proton.amqp.UnsignedLong

            {
                return UnsignedInteger.valueOf(value.getAs_uint());
            }
            else if(pn_type_t.PN_ULONG.equals(type))
            {
                return new UnsignedLong(value.getAs_ulong().longValue());
            }
            else if(pn_type_t.PN_USHORT.equals(type))
            {
                return UnsignedShort.valueOf((short) value.getAs_ushort());
            }
View Full Code Here

Examples of org.apache.qpid.proton.amqp.UnsignedLong

            {
                return UnsignedInteger.valueOf(value.getAs_uint());
            }
            else if(pn_type_t.PN_ULONG.equals(type))
            {
                return new UnsignedLong(value.getAs_ulong().longValue());
            }
            else if(pn_type_t.PN_USHORT.equals(type))
            {
                return UnsignedShort.valueOf((short) value.getAs_ushort());
            }
View Full Code Here

Examples of propel.core.userTypes.UnsignedLong

   * @throws NumberFormatException A number could not be parsed.
   */
  @Validate
  public static UnsignedLong fromBinaryToUInt64(@NotNull final String binary)
  {
    return new UnsignedLong(new BigInteger(binary, 2));
  }
View Full Code Here

Examples of propel.core.userTypes.UnsignedLong

   * @throws NumberFormatException A number could not be parsed.
   */
  @Validate
  public static UnsignedLong fromStringToUInt64(@NotNull final String value)
  {
    return new UnsignedLong(value);
  }
View Full Code Here

Examples of propel.core.userTypes.UnsignedLong

   * @throws NumberFormatException A number could not be parsed.
   */
  @Validate
  public static UnsignedLong fromHexToUInt64(@NotNull final String hex)
  {
    return new UnsignedLong(new BigInteger(hex, 16));
  }
View Full Code Here

Examples of propel.core.userTypes.UnsignedLong

    // convert blocks to alphanumerics
    StringBuilder sb = new StringBuilder(16);
    for (int i = offset; i < offset + length; i += 8)
    {
      byte[] ulBytes = ByteArrayUtils.subarray(ba, i, 8);
      UnsignedLong num = ByteArrayUtils.toUInt64(ulBytes);
      sb.append(toAlphanumeric(num, true));
    }

    return sb.toString();
  }
View Full Code Here

Examples of propel.core.userTypes.UnsignedLong

    byte[] result = new byte[alphanumeric.length() / 11 * 8];

    int j = 0;
    for (int i = 0; i < alphanumeric.length(); i += 11)
    {
      UnsignedLong num = fromAlphanumericToUInt64(alphanumeric.substring(i, i + 11));
      byte[] bytes = ByteArrayUtils.getBytes(num);
      System.arraycopy(bytes, 0, result, j, 8);
      j += 8;
    }

View Full Code Here

Examples of propel.core.userTypes.UnsignedLong

   */
  @Validate
  public static UnsignedLong fromAlphanumericToUInt64(@NotNull final String alphanumeric)
  {
    if (alphanumeric.equals(CONSTANT.ZERO))
      return new UnsignedLong(BigInteger.ZERO);

    UnsignedLong result = new UnsignedLong(BigInteger.ZERO);
    BigInteger sixtyTwo = new BigInteger("62");

    int len = alphanumeric.length();
    for (int i = 0; i < len; i++)
    {
      char ch = alphanumeric.charAt(i);
      if (!StringUtils.contains(CONSTANT.ALPHANUMERIC_DIGITS, ch))
        throw new NumberFormatException("The digit does not belong to the alphanumeric number structure: " + ch);

      // add and check for overflows
      int pos = len - i - 1;
      int charIndex = StringUtils.indexOf(CONSTANT.ALPHANUMERIC_DIGITS, ch);
      BigInteger added = sixtyTwo.pow(pos).multiply(new BigInteger(charIndex + ""));
      result = new UnsignedLong(result.bigIntegerValue().add(added));
    }

    return result;
  }
View Full Code Here

Examples of propel.core.userTypes.UnsignedLong

      return new UnsignedInteger((long) (number.intValue() & 0xFFFFFFFF));
    if (targetType.equals(UnsignedLong.class))
    {
      // perform similar operation as above to get rid of the negative values
      long ln = new BigInteger(number.toString()).longValue();
      return new UnsignedLong(new BigInteger("0" + toBinary(ln)));
    }
    if (targetType.equals(SignedByte.class))
      return new SignedByte(number.byteValue());
    if (targetType.equals(BigInteger.class))
      return new BigInteger(number.toString());
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.