Example usage for java.math BigDecimal hashCode

List of usage examples for java.math BigDecimal hashCode

Introduction

In this page you can find the example usage for java.math BigDecimal hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns the hash code for this BigDecimal .

Usage

From source file:Main.java

public static void main(String[] args) {

    BigDecimal bg1 = new BigDecimal("123");
    BigDecimal bg2 = new BigDecimal("123.50");
    BigDecimal bg3 = new BigDecimal("123.80");

    int i1 = bg1.hashCode();
    int i2 = bg2.hashCode();
    int i3 = bg3.hashCode();

    System.out.println(i1);//www. ja va2  s  . c  o m
    System.out.println(i2);
    System.out.println(i3);
}

From source file:org.apache.pig.data.SchemaTuple.java

protected int hashCodePiece(int hash, BigDecimal v, boolean isNull) {
    return isNull ? hash : 31 * hash + v.hashCode();
}