/** * Note, this is carefully aligned with hash codes for all xsd:decimal * primitives. */ protected int value_hash_code() { if (_value.scale() > 0) { if (_value.setScale(0, BigDecimal.ROUND_DOWN).compareTo(_value) != 0) return decimalHashCode(); } BigInteger intval = _value.toBigInteger(); if (intval.compareTo(_maxlong) > 0 || intval.compareTo(_minlong) < 0) return intval.hashCode(); long longval = intval.longValue(); return (int)((longval >> 32) * 19 + longval); }
/** * Note, this is carefully aligned with hash codes for all xsd:decimal * primitives. */ protected int value_hash_code() { if (_value.scale() > 0) { if (_value.setScale(0, BigDecimal.ROUND_DOWN).compareTo(_value) != 0) return decimalHashCode(); } BigInteger intval = _value.toBigInteger(); if (intval.compareTo(_maxlong) > 0 || intval.compareTo(_minlong) < 0) return intval.hashCode(); long longval = intval.longValue(); return (int)((longval >> 32) * 19 + longval); }
/** * Note, this is carefully aligned with hash codes for all xsd:decimal * primitives. */ protected int value_hash_code() { if (_value.scale() > 0) { if (_value.setScale(0, BigDecimal.ROUND_DOWN).compareTo(_value) != 0) return decimalHashCode(); } BigInteger intval = _value.toBigInteger(); if (intval.compareTo(_maxlong) > 0 || intval.compareTo(_minlong) < 0) return intval.hashCode(); long longval = intval.longValue(); return (int)((longval >> 32) * 19 + longval); }