Class HashHelper


  • public abstract class HashHelper
    extends Object
    This abstract class contains helper functions for calculating hash code values for any group of java intrinsics.
    Version:
    1.00, 04/25/00
    Author:
    pm
    • Constructor Summary

      Constructors 
      Constructor Description
      HashHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int hash​(boolean[] value, int hash)
      Calculate a running hash using the boolean array value.
      static int hash​(boolean value, int hash)
      Calculate a running hash using the boolean value.
      static int hash​(byte[] value, int hash)
      Calculate a running hash using the byte array value.
      static int hash​(byte value, int hash)
      Calculate a running hash using the byte value.
      static int hash​(char[] value, int hash)
      Calculate a running hash using the char array value.
      static int hash​(char value, int hash)
      Calculate a running hash using the char value.
      static int hash​(double[] value, int hash)
      Calculate a running hash using the double array value.
      static int hash​(double value, int hash)
      Calculate a running hash using the double value.
      static int hash​(float[] value, int hash)
      Calculate a running hash using the float array value.
      static int hash​(float value, int hash)
      Calculate a running hash using the float value.
      static int hash​(int[] value, int hash)
      Calculate a running hash using the int array value.
      static int hash​(int value, int hash)
      Calculate a running hash using the int value.
      static int hash​(long[] value, int hash)
      Calculate a running hash using the long array value.
      static int hash​(long value, int hash)
      Calculate a running hash using the long value.
      static int hash​(short[] value, int hash)
      Calculate a running hash using the short array value.
      static int hash​(short value, int hash)
      Calculate a running hash using the short value.
      static int hash​(Object[] value, int hash)
      Calculate a running hash using the Object array value.
      static int hash​(Object value, int hash)
      Calculate a running hash using the Object value.
      static String hash​(String s)
      Shift the value into a different charset order.
      static int hash​(Collection col, int hash)
      Calculate a running hash using the Collection value.
    • Constructor Detail

      • HashHelper

        public HashHelper()
    • Method Detail

      • hash

        public static int hash​(boolean value,
                               int hash)
        Calculate a running hash using the boolean value.
        Parameters:
        value - the boolean value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(byte value,
                               int hash)
        Calculate a running hash using the byte value.
        Parameters:
        value - the byte value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(char value,
                               int hash)
        Calculate a running hash using the char value.
        Parameters:
        value - the char value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(double value,
                               int hash)
        Calculate a running hash using the double value.
        Parameters:
        value - the double value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(float value,
                               int hash)
        Calculate a running hash using the float value.
        Parameters:
        value - the float value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(int value,
                               int hash)
        Calculate a running hash using the int value.
        Parameters:
        value - the int value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(long value,
                               int hash)
        Calculate a running hash using the long value.
        Parameters:
        value - the long value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(short value,
                               int hash)
        Calculate a running hash using the short value.
        Parameters:
        value - the short value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(Object value,
                               int hash)
        Calculate a running hash using the Object value.
        Parameters:
        value - the Object value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(boolean[] value,
                               int hash)
        Calculate a running hash using the boolean array value.
        Parameters:
        value - the boolean array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(byte[] value,
                               int hash)
        Calculate a running hash using the byte array value.
        Parameters:
        value - the byte array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(char[] value,
                               int hash)
        Calculate a running hash using the char array value.
        Parameters:
        value - the char array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(double[] value,
                               int hash)
        Calculate a running hash using the double array value.
        Parameters:
        value - the double array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(float[] value,
                               int hash)
        Calculate a running hash using the float array value.
        Parameters:
        value - the float array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(int[] value,
                               int hash)
        Calculate a running hash using the int array value.
        Parameters:
        value - the int array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(long[] value,
                               int hash)
        Calculate a running hash using the long array value.
        Parameters:
        value - the long array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(short[] value,
                               int hash)
        Calculate a running hash using the short array value.
        Parameters:
        value - the short array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(Object[] value,
                               int hash)
        Calculate a running hash using the Object array value.
        Parameters:
        value - the Object array value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static int hash​(Collection col,
                               int hash)
        Calculate a running hash using the Collection value. The hash computed over the Collection's entries is order-independent.
        Parameters:
        col - the Collection value for use in the hash
        hash - the running hash value
        Returns:
        the resulting running hash value
      • hash

        public static String hash​(String s)
        Shift the value into a different charset order.
        Parameters:
        s - a String
        Returns:
        a String with a different charset ordering