java.lang.Object
org.apache.lucene.util.bkd.BKDUtil
Utility functions to build BKD trees.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePredicate for a fixed number of bytes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcommonPrefixLength4(byte[] a, int aOffset, byte[] b, int bOffset) Return the length of the common prefix across the next 4 bytes of both provided arrays.static intcommonPrefixLength8(byte[] a, int aOffset, byte[] b, int bOffset) Return the length of the common prefix across the next 8 bytes of both provided arrays.(package private) static intcommonPrefixLengthN(byte[] a, int aOffset, byte[] b, int bOffset, int numBytes) static booleanequals4(byte[] a, int aOffset, byte[] b, int bOffset) Check whether the next 4 bytes are exactly the same in the provided arrays.static booleanequals8(byte[] a, int aOffset, byte[] b, int bOffset) Check whether the next 8 bytes are exactly the same in the provided arrays.static BKDUtil.ByteArrayPredicategetEqualsPredicate(int numBytes) Return a predicate that tells whether the nextnumBytesbytes are equal.getPrefixLengthComparator(int numBytes) Return a comparator that computes the common prefix length across the nextnumBytesof the provided arrays.
-
Constructor Details
-
BKDUtil
private BKDUtil()
-
-
Method Details
-
getPrefixLengthComparator
Return a comparator that computes the common prefix length across the nextnumBytesof the provided arrays. -
commonPrefixLength8
public static int commonPrefixLength8(byte[] a, int aOffset, byte[] b, int bOffset) Return the length of the common prefix across the next 8 bytes of both provided arrays. -
commonPrefixLength4
public static int commonPrefixLength4(byte[] a, int aOffset, byte[] b, int bOffset) Return the length of the common prefix across the next 4 bytes of both provided arrays. -
commonPrefixLengthN
static int commonPrefixLengthN(byte[] a, int aOffset, byte[] b, int bOffset, int numBytes) -
getEqualsPredicate
Return a predicate that tells whether the nextnumBytesbytes are equal. -
equals8
public static boolean equals8(byte[] a, int aOffset, byte[] b, int bOffset) Check whether the next 8 bytes are exactly the same in the provided arrays. -
equals4
public static boolean equals4(byte[] a, int aOffset, byte[] b, int bOffset) Check whether the next 4 bytes are exactly the same in the provided arrays.
-