Package org.neo4j.graphalgo.core.utils
Class BitUtil
- java.lang.Object
-
- org.neo4j.graphalgo.core.utils.BitUtil
-
public final class BitUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
align(long value, int alignment)
static long
ceilDiv(long dividend, long divisor)
static boolean
isPowerOfTwo(int value)
static boolean
isPowerOfTwo(long value)
static int
nearbyPowerOfTwo(int x)
static long
nearbyPowerOfTwo(long x)
static int
nextHighestPowerOfTwo(int v)
returns the next highest power of two, or the current value if it's already a power of two or zerostatic long
nextHighestPowerOfTwo(long v)
returns the next highest power of two, or the current value if it's already a power of two or zerostatic int
previousPowerOfTwo(int v)
returns the previous highest power of two, or the current value if it's already a power of two or zerostatic long
previousPowerOfTwo(long v)
returns the previous highest power of two, or the current value if it's already a power of two or zero
-
-
-
Method Detail
-
isPowerOfTwo
public static boolean isPowerOfTwo(int value)
-
isPowerOfTwo
public static boolean isPowerOfTwo(long value)
-
previousPowerOfTwo
public static int previousPowerOfTwo(int v)
returns the previous highest power of two, or the current value if it's already a power of two or zero
-
previousPowerOfTwo
public static long previousPowerOfTwo(long v)
returns the previous highest power of two, or the current value if it's already a power of two or zero
-
nearbyPowerOfTwo
public static int nearbyPowerOfTwo(int x)
-
nearbyPowerOfTwo
public static long nearbyPowerOfTwo(long x)
-
nextHighestPowerOfTwo
public static int nextHighestPowerOfTwo(int v)
returns the next highest power of two, or the current value if it's already a power of two or zero
-
nextHighestPowerOfTwo
public static long nextHighestPowerOfTwo(long v)
returns the next highest power of two, or the current value if it's already a power of two or zero
-
align
public static long align(long value, int alignment)
-
ceilDiv
public static long ceilDiv(long dividend, long divisor)
-
-