public final class Util extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Util.RandomCodePoints
Creates random valid Character Code Points (as integers).
|
| Modifier and Type | Method and Description |
|---|---|
static long |
binarySearchLongs(Memory mem,
long fromLongIndex,
long toLongIndex,
long key)
Searches a range of the specified array of longs for the specified value using the binary
search algorithm.
|
static String |
characterPad(String s,
int fieldLength,
char padChar,
boolean postpend)
Prepend or postpend the given string with the given character to fill the given field length.
|
static boolean |
isAllBitsClear(long value,
long bitMask)
Return true if all the masked bits of value are zero
|
static boolean |
isAllBitsSet(long value,
long bitMask)
Return true if all the masked bits of value are one
|
static boolean |
isAnyBitsClear(long value,
long bitMask)
Return true if any the masked bits of value are zero
|
static boolean |
isAnyBitsSet(long value,
long bitMask)
Return true if any the masked bits of value are one
|
static String |
zeroPad(String s,
int fieldLength)
Prepend the given string with zeros.
|
public static long binarySearchLongs(Memory mem, long fromLongIndex, long toLongIndex, long key)
mem - the Memory to be searchedfromLongIndex - the index of the first element (inclusive) to be searchedtoLongIndex - the index of the last element (exclusive) to be searchedkey - the value to be searched forpublic static final String zeroPad(String s, int fieldLength)
s - the given stringfieldLength - desired total field length including the given stringpublic static final String characterPad(String s, int fieldLength, char padChar, boolean postpend)
s - the given stringfieldLength - the desired field lengthpadChar - the desired pad characterpostpend - if true append the pacCharacters to the end of the string.public static final boolean isAllBitsClear(long value,
long bitMask)
value - the value to be testedbitMask - defines the bits of interestpublic static final boolean isAllBitsSet(long value,
long bitMask)
value - the value to be testedbitMask - defines the bits of interestpublic static final boolean isAnyBitsClear(long value,
long bitMask)
value - the value to be testedbitMask - defines the bits of interestpublic static final boolean isAnyBitsSet(long value,
long bitMask)
value - the value to be testedbitMask - defines the bits of interestCopyright © 2015–2019 Yahoo! Inc.. All rights reserved.