AdHash (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server.util

## Class AdHash

- java.lang.Object
- - org.apache.zookeeper.server.util.AdHash

-     public class AdHash
      extends Object

  This incremental hash is used to keep track of the hash of the data tree to that we can quickly validate that things are in sync. See the excellent paper: A New Paradigm for collision-free hashing: Incrementality at reduced cost, M. Bellare and D. Micciancio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdHash()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AdHash` | `addDigest(long digest)` Add new digest to the hash value maintained in this class.
    `void` | `clear()`
    `boolean` | `equals(Object other)`
    `long` | `getHash()` Return the long value of the hash.
    `int` | `hashCode()`
    `AdHash` | `removeDigest(long digest)` Remove the digest from the hash value.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AdHash

          public AdHash()

  - ### Method Detail

    - #### addDigest

          public AdHash addDigest(long digest)

      Add new digest to the hash value maintained in this class.
      Parameters:
        `digest` - the value to add on
      Returns:
        the AdHash itself for chained operations

    - #### removeDigest

          public AdHash removeDigest(long digest)

      Remove the digest from the hash value.
      Parameters:
        `digest` - the value to remove
      Returns:
        the AdHash itself for chained operations

    - #### getHash

          public long getHash()

      Return the long value of the hash.

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### clear

          public void clear()

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.