public final class BufferUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
USE_HYBRID_BINSEARCH |
| Modifier and Type | Method and Description |
|---|---|
protected static int |
advanceUntil(ShortBuffer array,
int pos,
int length,
short min)
Find the smallest integer larger than pos such that array[pos]>= min.
|
protected static void |
arraycopy(ShortBuffer src,
int srcPos,
ShortBuffer dest,
int destPos,
int length) |
protected static int |
branchyUnsignedBinarySearch(ShortBuffer array,
int begin,
int end,
short k) |
static int |
compareUnsigned(short a,
short b)
Compares the two specified
short values, treating them as unsigned values between
0 and 2^16 - 1 inclusive. |
protected static void |
fillArrayAND(short[] container,
LongBuffer bitmap1,
LongBuffer bitmap2) |
protected static void |
fillArrayANDNOT(short[] container,
LongBuffer bitmap1,
LongBuffer bitmap2) |
protected static void |
fillArrayXOR(short[] container,
LongBuffer bitmap1,
LongBuffer bitmap2) |
static void |
flipBitmapRange(LongBuffer bitmap,
int start,
int end)
flip bits at start, start+1,..., end-1
|
protected static int |
getSizeInBytesFromCardinalityEtc(int card,
int numRuns,
boolean isRunEncoded)
From the cardinality of a container, compute the corresponding size in
bytes of the container.
|
protected static short |
highbits(int x) |
protected static int |
hybridUnsignedBinarySearch(ShortBuffer array,
int begin,
int end,
short k) |
protected static boolean |
isBackedBySimpleArray(Buffer b) |
protected static short |
lowbits(int x) |
protected static short |
maxLowBit() |
protected static int |
maxLowBitAsInteger() |
protected static int |
oldunsignedOneSidedGallopingIntersect2by2(ShortBuffer smallSet,
int smallLength,
ShortBuffer largeSet,
int largeLength,
short[] buffer) |
static void |
resetBitmapRange(LongBuffer bitmap,
int start,
int end)
clear bits at start, start+1,..., end-1
|
static void |
setBitmapRange(LongBuffer bitmap,
int start,
int end)
set bits at start, start+1,..., end-1
|
protected static int |
toIntUnsigned(short x) |
static int |
unsignedBinarySearch(ShortBuffer array,
int begin,
int end,
short k)
Look for value k in buffer in the range [begin,end).
|
protected static int |
unsignedDifference(ShortBuffer set1,
int length1,
ShortBuffer set2,
int length2,
short[] buffer) |
protected static int |
unsignedExclusiveUnion2by2(ShortBuffer set1,
int length1,
ShortBuffer set2,
int length2,
short[] buffer) |
protected static int |
unsignedIntersect2by2(ShortBuffer set1,
int length1,
ShortBuffer set2,
int length2,
short[] buffer) |
static boolean |
unsignedIntersects(ShortBuffer set1,
int length1,
ShortBuffer set2,
int length2)
Checks if two arrays intersect
|
protected static int |
unsignedLocalIntersect2by2(ShortBuffer set1,
int length1,
ShortBuffer set2,
int length2,
short[] buffer) |
protected static int |
unsignedOneSidedGallopingIntersect2by2(ShortBuffer smallSet,
int smallLength,
ShortBuffer largeSet,
int largeLength,
short[] buffer) |
protected static int |
unsignedUnion2by2(ShortBuffer set1,
int length1,
ShortBuffer set2,
int length2,
short[] buffer) |
public static void flipBitmapRange(LongBuffer bitmap, int start, int end)
bitmap - array of words to be modifiedstart - first index to be modified (inclusive)end - last index to be modified (exclusive)public static void resetBitmapRange(LongBuffer bitmap, int start, int end)
bitmap - array of words to be modifiedstart - first index to be modified (inclusive)end - last index to be modified (exclusive)public static void setBitmapRange(LongBuffer bitmap, int start, int end)
bitmap - array of words to be modifiedstart - first index to be modified (inclusive)end - last index to be modified (exclusive)protected static int advanceUntil(ShortBuffer array, int pos, int length, short min)
array - container where we searchpos - initial positionmin - minimal thresholdlength - how big should the array consider to beprotected static void fillArrayAND(short[] container,
LongBuffer bitmap1,
LongBuffer bitmap2)
protected static void fillArrayANDNOT(short[] container,
LongBuffer bitmap1,
LongBuffer bitmap2)
protected static void fillArrayXOR(short[] container,
LongBuffer bitmap1,
LongBuffer bitmap2)
protected static int getSizeInBytesFromCardinalityEtc(int card,
int numRuns,
boolean isRunEncoded)
card - the cardinality if this is not run encoded, otherwise ignorednumRuns - number of runs if run encoded, othewise ignoredisRunEncoded - booleanprotected static boolean isBackedBySimpleArray(Buffer b)
protected static short highbits(int x)
protected static short lowbits(int x)
protected static short maxLowBit()
protected static int maxLowBitAsInteger()
protected static void arraycopy(ShortBuffer src, int srcPos, ShortBuffer dest, int destPos, int length)
protected static int toIntUnsigned(short x)
public static int unsignedBinarySearch(ShortBuffer array, int begin, int end, short k)
array - buffer where we searchbegin - first index (inclusive)end - last index (exclusive)k - value we search forprotected static int hybridUnsignedBinarySearch(ShortBuffer array, int begin, int end, short k)
protected static int branchyUnsignedBinarySearch(ShortBuffer array, int begin, int end, short k)
protected static int unsignedDifference(ShortBuffer set1, int length1, ShortBuffer set2, int length2, short[] buffer)
protected static int unsignedExclusiveUnion2by2(ShortBuffer set1, int length1, ShortBuffer set2, int length2, short[] buffer)
protected static int unsignedIntersect2by2(ShortBuffer set1, int length1, ShortBuffer set2, int length2, short[] buffer)
protected static int unsignedOneSidedGallopingIntersect2by2(ShortBuffer smallSet, int smallLength, ShortBuffer largeSet, int largeLength, short[] buffer)
protected static int unsignedLocalIntersect2by2(ShortBuffer set1, int length1, ShortBuffer set2, int length2, short[] buffer)
protected static int oldunsignedOneSidedGallopingIntersect2by2(ShortBuffer smallSet, int smallLength, ShortBuffer largeSet, int largeLength, short[] buffer)
protected static int unsignedUnion2by2(ShortBuffer set1, int length1, ShortBuffer set2, int length2, short[] buffer)
public static int compareUnsigned(short a,
short b)
short values, treating them as unsigned values between
0 and 2^16 - 1 inclusive.a - the first unsigned short to compareb - the second unsigned short to comparea is less than b; a positive value if a is
greater than b; or zero if they are equalpublic static boolean unsignedIntersects(ShortBuffer set1, int length1, ShortBuffer set2, int length2)
set1 - first arraylength1 - length of first arrayset2 - second arraylength2 - length of second arrayCopyright © 2015. All Rights Reserved.