Class AbstractStatelessLongHash

  • All Implemented Interfaces:
    Hash, StatelessHash, StatelessLongHash

    public abstract class AbstractStatelessLongHash
    extends java.lang.Object
    implements StatelessLongHash
    Base implementation for stateless (but not incremental) long integer hash functions.
    • Constructor Detail

      • AbstractStatelessLongHash

        public AbstractStatelessLongHash()
    • Method Detail

      • calculate

        public long calculate​(byte[] input)
        Description copied from interface: StatelessLongHash
        Evaluates this hash function for the entire given input array.
        Specified by:
        calculate in interface StatelessLongHash
        Parameters:
        input - the input array
        Returns:
        the output of the hash function
      • calculate

        public long calculate​(byte[] input,
                              int index,
                              int length)
        Description copied from interface: StatelessLongHash
        Evaluates this hash function for the given range of the given input array.
        Specified by:
        calculate in interface StatelessLongHash
        Parameters:
        input - the input array
        index - the starting index of the first input byte
        length - the length of the input range
        Returns:
        the output of the hash function
      • calculate

        public long calculate​(java.nio.ByteBuffer input)
        Description copied from interface: StatelessLongHash
        Evaluates this hash function with the remaining contents of the given input buffer. This method leaves the buffer position at the limit.
        Specified by:
        calculate in interface StatelessLongHash
        Parameters:
        input - the input buffer
        Returns:
        the output of the hash function
      • calculate

        public long calculate​(long address,
                              long length)
        Description copied from interface: StatelessLongHash
        Evaluates this hash function for the memory with the given address and length. The arguments are generally not checked in any way and will likely lead to a VM crash or undefined results if invalid.
        Specified by:
        calculate in interface StatelessLongHash
        Parameters:
        address - the base address of the input
        length - the length of the input
        Returns:
        the output of the hash function
        See Also:
        Hash.supportsUnsafe()
      • calculateUnchecked

        protected abstract long calculateUnchecked​(byte[] input,
                                                   int index,
                                                   int length)
        Evaluates this hash function for the given range of the given input array. The index and length parameters have already been validated.
        Parameters:
        input - the input array
        index - the starting index of the first input byte
        length - the length of the input range
        Returns:
        the output of the hash function