public final class Util
extends java.lang.Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static int |
ceilingNextPowerOfTwo(int x)
Calculate the next power of 2, greater than or equal to x.
|
static long |
getMinimumSequence(Sequence[] sequences)
Get the minimum sequence from an array of
Sequences. |
static long |
getMinimumSequence(Sequence[] sequences,
long minimum)
Get the minimum sequence from an array of
Sequences. |
static Sequence[] |
getSequencesFor(EventProcessor... processors)
Get an array of
Sequences for the passed EventProcessors |
static sun.misc.Unsafe |
getUnsafe()
Get a handle on the Unsafe instance, used for accessing low-level concurrency
and memory constructs.
|
static int |
log2(int i)
Calculate the log base 2 of the supplied integer, essentially reports the location
of the highest bit.
|
public static int ceilingNextPowerOfTwo(int x)
From Hacker's Delight, Chapter 3, Harry S. Warren Jr.
x - Value to round uppublic static long getMinimumSequence(Sequence[] sequences)
Sequences.sequences - to compare.public static long getMinimumSequence(Sequence[] sequences, long minimum)
Sequences.sequences - to compare.minimum - an initial default minimum. If the array is empty this value will be
returned.sequences and minimum;
minimum if sequences is emptypublic static Sequence[] getSequencesFor(EventProcessor... processors)
Sequences for the passed EventProcessorsprocessors - for which to get the sequencesSequencespublic static sun.misc.Unsafe getUnsafe()
public static int log2(int i)
i - Value to calculate log2 for.Copyright © 2011 - 2018 LMAX Ltd. All Rights Reserved.