Class HashCode.IntHashCode

java.lang.Object
com.google.common.hash.HashCode
com.google.common.hash.HashCode.IntHashCode
All Implemented Interfaces:
Serializable
Enclosing class:
HashCode

private static final class HashCode.IntHashCode extends HashCode implements Serializable
  • Field Details

    • hash

      final int hash
    • serialVersionUID

      private static final long serialVersionUID
      See Also:
  • Constructor Details

    • IntHashCode

      IntHashCode(int hash)
  • Method Details

    • bits

      public int bits()
      Description copied from class: HashCode
      Returns the number of bits in this hash code; a positive multiple of 8.
      Specified by:
      bits in class HashCode
    • asBytes

      public byte[] asBytes()
      Description copied from class: HashCode
      Returns the value of this hash code as a byte array. The caller may modify the byte array; changes to it will not be reflected in this HashCode object or any other arrays returned by this method.
      Specified by:
      asBytes in class HashCode
    • asInt

      public int asInt()
      Description copied from class: HashCode
      Returns the first four bytes of this hashcode's bytes, converted to an int value in little-endian order.
      Specified by:
      asInt in class HashCode
    • asLong

      public long asLong()
      Description copied from class: HashCode
      Returns the first eight bytes of this hashcode's bytes, converted to a long value in little-endian order.
      Specified by:
      asLong in class HashCode
    • padToLong

      public long padToLong()
      Description copied from class: HashCode
      If this hashcode has enough bits, returns asLong(), otherwise returns a long value with asBytes() as the least-significant bytes and 0x00 as the remaining most-significant bytes.
      Specified by:
      padToLong in class HashCode
    • writeBytesToImpl

      void writeBytesToImpl(byte[] dest, int offset, int maxLength)
      Specified by:
      writeBytesToImpl in class HashCode
    • equalsSameBits

      boolean equalsSameBits(HashCode that)
      Description copied from class: HashCode
      Returns whether this HashCode and that HashCode have the same value, given that they have the same number of bits.
      Specified by:
      equalsSameBits in class HashCode