Class HashCode.IntHashCode

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    HashCode

    private static final class HashCode.IntHashCode
    extends HashCode
    implements java.io.Serializable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int hash  
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      IntHashCode​(int hash)  
    • Field Detail

      • hash

        final int hash
    • Constructor Detail

      • IntHashCode

        IntHashCode​(int hash)
    • Method Detail

      • 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