public final class Util extends Object
Constructor | Description |
---|---|
Util() |
Modifier and Type | Method | Description |
---|---|---|
static int |
ceilingNextPowerOfTwo(int x) |
Calculate the next power of 2, greater than or equal to x.
|
static long |
getAddressFromDirectByteBuffer(ByteBuffer buffer) |
Gets the address value for the memory that backs a direct byte buffer.
|
static long |
getMinimumSequence(Sequence[] sequences) |
Get the minimum sequence from an array of
Sequence s. |
static long |
getMinimumSequence(Sequence[] sequences,
long minimum) |
Get the minimum sequence from an array of
Sequence s. |
static Sequence[] |
getSequencesFor(EventProcessor... processors) |
Get an array of
Sequence s for the passed EventProcessor s |
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)
Sequence
s.sequences
- to compare.public static long getMinimumSequence(Sequence[] sequences, long minimum)
Sequence
s.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)
Sequence
s for the passed EventProcessor
sprocessors
- for which to get the sequencesSequence
spublic static sun.misc.Unsafe getUnsafe()
public static long getAddressFromDirectByteBuffer(ByteBuffer buffer)
buffer
- public static int log2(int i)
i
- Value to calculate log2 for.Copyright © 2019. All rights reserved.