Example usage for org.joda.time Duration hashCode

List of usage examples for org.joda.time Duration hashCode

Introduction

In this page you can find the example usage for org.joda.time Duration hashCode.

Prototype

public int hashCode() 

Source Link

Document

Gets a hash code for the duration that is compatible with the equals method.

Usage

From source file:rcrr.reversi.Clock.java

License:Open Source License

/**
 * Returns a hash code value for the clock object.
 *
 * @return a hash code value for this clock
 *///from  w ww  .  java  2  s .  c o m
@Override
public int hashCode() {
    if (hashCode == 0) {
        int result = PRIME_NUMBER_17;
        for (Duration duration : this.durations.values()) {
            int k = duration.hashCode();
            result = PRIME_NUMBER_37 * result + k;
        }
        hashCode = result;
    }
    return hashCode;
}