Package com.scurrilous.circe
Enum Class HashSupport
- All Implemented Interfaces:
Serializable,Comparable<HashSupport>,Constable
Flags indicating the support available for some set of hash algorithm.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classComparatorforEnumSetsfor hash support flags.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates that the hash algorithm is available in hardware-accelerated native code.Indicates that the hash algorithm is available in hardware-accelerated native code as anIncrementalIntHashorIncrementalLongHash, depending on which ofINT_SIZEDorLONG_SIZEDis set.Indicates that the hash algorithm is available as an incremental stateful hash function, for whichStatefulHash.supportsIncremental()returnstrue.Indicates that the hash algorithm is available as aStatefulIntHashandStatelessIntHash.Indicates that the hash algorithm is available as aStatefulLongHashandStatelessLongHash.Indicates that the hash algorithm is available in native code.Indicates that the hash algorithm is available in native code as aIncrementalIntHashorIncrementalLongHash, depending on which ofINT_SIZEDorLONG_SIZEDis set.Indicates that the hash algorithm is available as aStatefulHash.Indicates that the hash algorithm is available as aIncrementalIntHashorIncrementalLongHash, depending on which ofINT_SIZEDorLONG_SIZEDis set.Indicates that the stateful hash algorithm unsafe memory access viaStatefulHash.update(long, long).Indicates that the incremental hash algorithm supports unsafe memory access viaIncrementalIntHash.resume(int, long, long)orIncrementalLongHash.resume(long, long, long), depending on which ofINT_SIZEDorLONG_SIZEDis set. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum priority value, indicating the lowest priority.static final intThe minimum priority value, indicating the highest priority. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompare(EnumSet<HashSupport> set1, EnumSet<HashSupport> set2) Compares the given sets of hash algorithm support flags for priority order.static intgetMaxPriority(EnumSet<HashSupport> set) Returns the priority of the highest-priority hash algorithm support flag in the given set of flags.intReturns the relative priority of a hash algorithm support flag, which is an indicator of its performance and flexibility.static HashSupportReturns the enum constant of this class with the specified name.static HashSupport[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HARDWARE_INCREMENTAL
Indicates that the hash algorithm is available in hardware-accelerated native code as anIncrementalIntHashorIncrementalLongHash, depending on which ofINT_SIZEDorLONG_SIZEDis set. -
HARDWARE
Indicates that the hash algorithm is available in hardware-accelerated native code. -
NATIVE_INCREMENTAL
Indicates that the hash algorithm is available in native code as aIncrementalIntHashorIncrementalLongHash, depending on which ofINT_SIZEDorLONG_SIZEDis set. -
NATIVE
Indicates that the hash algorithm is available in native code. -
UNSAFE_INCREMENTAL
Indicates that the incremental hash algorithm supports unsafe memory access viaIncrementalIntHash.resume(int, long, long)orIncrementalLongHash.resume(long, long, long), depending on which ofINT_SIZEDorLONG_SIZEDis set. -
UNSAFE
Indicates that the stateful hash algorithm unsafe memory access viaStatefulHash.update(long, long). IfINT_SIZEDis also set, the function returned byStatefulIntHash.asStateless()also supportsStatelessIntHash.calculate(long, long). Similarly, ifLONG_SIZEDis also set, the function returned byStatefulLongHash.asStateless()also supportsStatelessLongHash.calculate(long, long). -
STATELESS_INCREMENTAL
Indicates that the hash algorithm is available as aIncrementalIntHashorIncrementalLongHash, depending on which ofINT_SIZEDorLONG_SIZEDis set. -
INCREMENTAL
Indicates that the hash algorithm is available as an incremental stateful hash function, for whichStatefulHash.supportsIncremental()returnstrue. This flag is implied bySTATELESS_INCREMENTAL. -
INT_SIZED
Indicates that the hash algorithm is available as aStatefulIntHashandStatelessIntHash. -
LONG_SIZED
Indicates that the hash algorithm is available as aStatefulLongHashandStatelessLongHash. -
STATEFUL
Indicates that the hash algorithm is available as aStatefulHash. If this flag is not set, the algorithm is not supported at all.
-
-
Field Details
-
MIN_PRIORITY
public static final int MIN_PRIORITYThe minimum priority value, indicating the highest priority. All flags have a priority value greater than this.- See Also:
-
MAX_PRIORITY
public static final int MAX_PRIORITYThe maximum priority value, indicating the lowest priority. All flags have a priority value less than this.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- 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
Returns the priority of the highest-priority hash algorithm support flag in the given set of flags. If the set is empty,MAX_PRIORITYis returned.- Parameters:
set- a set of hash algorithm support flags- Returns:
- the highest priority (lowest value) in the set, or
MAX_PRIORITYif empty
-
compare
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 comparedset2- 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
-