public class BitMaskUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
areEqual(BitMask mask1,
BitMask mask2)
Are two bit masks equal?
|
static <T extends java.lang.Enum<T> & BitFlag> |
areEqual(EnumBitMask<T> mask1,
EnumBitMask<T> mask2)
Are two enum bit masks equal?
|
static int |
getHash64(long value)
Get a hash value for a long value.
|
static BitMask |
toBitMask(BitFlag flag)
Convert a bit flag into a bit mask.
|
public static int getHash64(long value)
value
- long valuepublic static boolean areEqual(@NotNull BitMask mask1, @NotNull BitMask mask2)
This compares whether the same bit flags are set in both masks. For masks with different lengths the missing flags in the shorter mask are considered to be unset.
mask1
- first maskmask2
- second masktrue
if both masks are considered equal, otherwise false
public static <T extends java.lang.Enum<T> & BitFlag> boolean areEqual(@NotNull EnumBitMask<T> mask1, @NotNull EnumBitMask<T> mask2)
T
- enum bit flagmask1
- first maskmask2
- second masktrue
if both masks are considered equal, otherwise false