public final class BufferUtil extends Object
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(ByteBuffer array,
int position,
int begin,
int end,
short k) |
protected static int |
branchyUnsignedBinarySearch(ShortBuffer array,
int begin,
int end,
short k) |
static int |
cardinalityInBitmapRange(LongBuffer bitmap,
int start,
int end)
Hamming weight of the bitset in the range
start, start+1,..., end-1
|
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
|
static int |
flipBitmapRangeAndCardinalityChange(LongBuffer bitmap,
int start,
int end)
Deprecated.
|
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 short |
highbits(long x) |
protected static boolean |
isBackedBySimpleArray(Buffer b)
Checks whether the Buffer is backed by a simple array.
|
protected static short |
lowbits(int x) |
protected static short |
lowbits(long x) |
protected static short |
maxLowBit() |
protected static int |
maxLowBitAsInteger() |
static void |
resetBitmapRange(LongBuffer bitmap,
int start,
int end)
clear bits at start, start+1,..., end-1
|
static int |
resetBitmapRangeAndCardinalityChange(LongBuffer bitmap,
int start,
int end)
Deprecated.
|
static void |
setBitmapRange(LongBuffer bitmap,
int start,
int end)
set bits at start, start+1,..., end-1
|
static int |
setBitmapRangeAndCardinalityChange(LongBuffer bitmap,
int start,
int end)
Deprecated.
|
protected static int |
toIntUnsigned(short x) |
static int |
unsignedBinarySearch(ByteBuffer array,
int position,
int begin,
int end,
short k)
Look for value k in buffer in the range [begin,end).
|
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 |
unsignedLocalIntersect2by2Cardinality(ShortBuffer set1,
int length1,
ShortBuffer set2,
int length2) |
protected static int |
unsignedOneSidedGallopingIntersect2by2(ShortBuffer smallSet,
int smallLength,
ShortBuffer largeSet,
int largeLength,
short[] buffer) |
protected static int |
unsignedUnion2by2(ShortBuffer set1,
int offset1,
int length1,
ShortBuffer set2,
int offset2,
int length2,
short[] buffer) |
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 arraycopy(ShortBuffer src, int srcPos, ShortBuffer dest, int destPos, int length)
protected static int branchyUnsignedBinarySearch(ShortBuffer array, int begin, int end, short k)
protected static int branchyUnsignedBinarySearch(ByteBuffer array, int position, int begin, int end, short k)
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 equalprotected 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)
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 int cardinalityInBitmapRange(LongBuffer bitmap, int start, int end)
bitmap
- array of words representing a bitsetstart
- first index (inclusive)end
- last index (exclusive)@Deprecated public static int setBitmapRangeAndCardinalityChange(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)@Deprecated public static int flipBitmapRangeAndCardinalityChange(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)@Deprecated public static int resetBitmapRangeAndCardinalityChange(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 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 short highbits(int x)
protected static short highbits(long x)
protected static boolean isBackedBySimpleArray(Buffer b)
b
- the provided Bufferprotected static short lowbits(int x)
protected static short lowbits(long x)
protected static short maxLowBit()
protected static int maxLowBitAsInteger()
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 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 forpublic static int unsignedBinarySearch(ByteBuffer array, int position, int begin, int end, short k)
array
- buffer where we searchposition
- starting position of the container in the ByteBufferbegin
- first index (inclusive)end
- last index (exclusive)k
- value we search forprotected 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)
public static boolean unsignedIntersects(ShortBuffer set1, int length1, ShortBuffer set2, int length2)
set1
- first arraylength1
- length of first arrayset2
- second arraylength2
- length of second arrayprotected static int unsignedLocalIntersect2by2(ShortBuffer set1, int length1, ShortBuffer set2, int length2, short[] buffer)
protected static int unsignedLocalIntersect2by2Cardinality(ShortBuffer set1, int length1, ShortBuffer set2, int length2)
protected static int unsignedOneSidedGallopingIntersect2by2(ShortBuffer smallSet, int smallLength, ShortBuffer largeSet, int largeLength, short[] buffer)
protected static int unsignedUnion2by2(ShortBuffer set1, int offset1, int length1, ShortBuffer set2, int offset2, int length2, short[] buffer)
Copyright © 2018. All rights reserved.