src/hash-code/builder.js
function HashCodeBuilder(initial, multiplier) {
  if (initial == null) {
    initial = HashCodeBuilder.DEFAULT_INITIAL_VALUE;
  } else if (initial % 2 === 0) {
    throw new Error('initial must be an odd number');
  }

  if (multiplier == null) {
    multiplier = HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE;
  } else if (multiplier % 2 === 0) {
    throw new Error('multiplier must be an odd number');
  }

  /**
   * The current hash code for this {@link HashCodeBuilder}.
   *
   * @private
   * @type {number}
   */
  this._hash = initial;

  /**
   * The multiplier to be used by this {@link HashCodeBuilder}.
   *
   * @private
   * @type {number}
   */
  this._multiplier = multiplier;
}
function HashCodeBuilder(initial, multiplier) {
  if (initial == null) {
    initial = HashCodeBuilder.DEFAULT_INITIAL_VALUE;
  } else if (initial % 2 === 0) {
    throw new Error('initial must be an odd number');
  }

  if (multiplier == null) {
    multiplier = HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE;
  } else if (multiplier % 2 === 0) {
    throw new Error('multiplier must be an odd number');
  }

  /**
   * The current hash code for this {@link HashCodeBuilder}.
   *
   * @private
   * @type {number}
   */
  this._hash = initial;

  /**
   * The multiplier to be used by this {@link HashCodeBuilder}.
   *
   * @private
   * @type {number}
   */
  this._multiplier = multiplier;
}
function HashCodeBuilder ( initial , multiplier ) { if ( initial == null ) { initial = HashCodeBuilder . DEFAULT_INITIAL_VALUE ; } else if ( initial % 2 === 0 ) { throw new Error ( 'initial must be an odd number' ) ; } if ( multiplier == null ) { multiplier = HashCodeBuilder . DEFAULT_MULTIPLIER_VALUE ; } else if ( multiplier % 2 === 0 ) { throw new Error ( 'multiplier must be an odd number' ) ; } /**
   * The current hash code for this {@link HashCodeBuilder}.
   *
   * @private
   * @type {number}
   */ this . _hash = initial ; /**
   * The multiplier to be used by this {@link HashCodeBuilder}.
   *
   * @private
   * @type {number}
   */ this . _multiplier = multiplier ; }
Assists in building hash codes for complex classes.

Ideally the <code>initial</code> value and <code>multiplier</code> should be different for each class, however, this
is not vital. Prime numbers are preferred, especially for <code>multiplier</code>.

@param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be
<code>null</code> but cannot be even)
@param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be
<code>null</code> but cannot be even)
@throws {Error} If either <code>initial</code> or <code>multiplier</code> are even numbers.
@public
@constructor
Assists in building hash codes for complex classes .