Package java.math

Examples of java.math.BigInteger.abs()


        } else {
            // use default if set
            BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
            if (defaultYear != null) {
                result.set(Calendar.ERA, defaultYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
                result.set(Calendar.YEAR, defaultYear.abs().intValue());
            }
        }

        // only set month if it is set
        if (month != DatatypeConstants.FIELD_UNDEFINED) {
View Full Code Here


                result.set(Calendar.YEAR, Math.abs(year));
            }
            else {
                BigInteger eonAndYear = getEonAndYear();
                result.set(Calendar.ERA, eonAndYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
                result.set(Calendar.YEAR, eonAndYear.abs().intValue());
            }
        }

        // only set month if it is set
        if (month != DatatypeConstants.FIELD_UNDEFINED) {
View Full Code Here

                result.set(Calendar.YEAR, Math.abs(year));
            }
            else {
                final BigInteger eonAndYear = getEonAndYear();
                result.set(Calendar.ERA, eonAndYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
                result.set(Calendar.YEAR, eonAndYear.abs().intValue());
            }
        }
        else {
            // use default if set
            if (defaults != null) {
View Full Code Here

                        result.set(Calendar.YEAR, Math.abs(defaultYear));
                    }
                    else {
                        final BigInteger defaultEonAndYear = defaults.getEonAndYear();
                        result.set(Calendar.ERA, defaultEonAndYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
                        result.set(Calendar.YEAR, defaultEonAndYear.abs().intValue());
                    }
                }
            }
        }
View Full Code Here

    public static BigInteger hash(String data)
    {
        byte[] result = hash("MD5", data.getBytes());
        BigInteger hash = new BigInteger(result);
        return hash.abs();       
    }

    public static byte[] hash(String type, byte[]... data)
    {
      byte[] result = null;
View Full Code Here

 
  // if year( and eon) are undefined, leave default Calendar values
  BigInteger year = getEonAndYear();
  if (year != null) {
    result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
    result.set(Calendar.YEAR, year.abs().intValue());
  }
 
  // only set month if it is set
  if (month != DatatypeConstants.FIELD_UNDEFINED) {
    // Calendar.MONTH is zero based while XMLGregorianCalendar month field is not.
View Full Code Here

  // if year( and eon) are undefined, leave default Calendar values
  BigInteger year = getEonAndYear();
  if (year != null) {
    result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
    result.set(Calendar.YEAR, year.abs().intValue());
  } else {
    // use default if set
    BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
    if (defaultYear != null) {
      result.set(Calendar.ERA, defaultYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
View Full Code Here

  } else {
    // use default if set
    BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
    if (defaultYear != null) {
      result.set(Calendar.ERA, defaultYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
      result.set(Calendar.YEAR, defaultYear.abs().intValue());
    }
  }
 
  // only set month if it is set
  if (month != DatatypeConstants.FIELD_UNDEFINED) {
View Full Code Here

    public static BigInteger hashToBigInteger(ByteBuffer data)
    {
        byte[] result = hash(data);
        BigInteger hash = new BigInteger(result);
        return hash.abs();       
    }

    public static byte[] hash(ByteBuffer... data)
    {
        MessageDigest messageDigest = localMD5Digest.get();
View Full Code Here

    public static BigInteger hashToBigInteger(ByteBuffer data)
    {
        byte[] result = hash(data);
        BigInteger hash = new BigInteger(result);
        return hash.abs();       
    }

    public static byte[] hash(ByteBuffer... data)
    {
        MessageDigest messageDigest = localMD5Digest.get();
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.