Enum HashSupport

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<HashSupport>

    public enum HashSupport
    extends java.lang.Enum<HashSupport>
    Flags indicating the support available for some set of hash algorithm.
    • Field Detail

      • MIN_PRIORITY

        public static final int MIN_PRIORITY
        The minimum priority value, indicating the highest priority. All flags have a priority value greater than this.
        See Also:
        Constant Field Values
      • MAX_PRIORITY

        public static final int MAX_PRIORITY
        The maximum priority value, indicating the lowest priority. All flags have a priority value less than this.
        See Also:
        Constant Field Values
    • Method Detail

      • values

        public static HashSupport[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HashSupport c : HashSupport.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HashSupport valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getPriority

        public int getPriority()
        Returns the relative priority of a hash algorithm support flag, which is an indicator of its performance and flexibility. Lower values indicate higher priority.
        Returns:
        the priority of this flag (currently between 10 and 90)
      • getMaxPriority

        public static int getMaxPriority​(java.util.EnumSet<HashSupport> set)
        Returns the priority of the highest-priority hash algorithm support flag in the given set of flags. If the set is empty, MAX_PRIORITY is returned.
        Parameters:
        set - a set of hash algorithm support flags
        Returns:
        the highest priority (lowest value) in the set, or MAX_PRIORITY if empty
      • compare

        public static int compare​(java.util.EnumSet<HashSupport> set1,
                                  java.util.EnumSet<HashSupport> set2)
        Compares the given sets of hash algorithm support flags for priority order. The set with the highest priority flag without a flag of matching priority in the other set has higher priority.
        Parameters:
        set1 - the first set to be compared
        set2 - the second set to be compared
        Returns:
        a negative integer, zero, or a positive integer if the first set has priority higher than, equal to, or lower than the second