Package org.apache.lucene.util.bkd
Class BKDUtil
java.lang.Object
org.apache.lucene.util.bkd.BKDUtil
Utility functions to build BKD trees.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Predicate for a fixed number of bytes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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.(package private) static int
commonPrefixLengthN
(byte[] a, int aOffset, byte[] b, int bOffset, int numBytes) 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.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.static BKDUtil.ByteArrayPredicate
getEqualsPredicate
(int numBytes) Return a predicate that tells whether the nextnumBytes
bytes are equal.getPrefixLengthComparator
(int numBytes) Return a comparator that computes the common prefix length across the nextnumBytes
of the provided arrays.
-
Constructor Details
-
BKDUtil
private BKDUtil()
-
-
Method Details
-
getPrefixLengthComparator
Return a comparator that computes the common prefix length across the nextnumBytes
of 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 nextnumBytes
bytes 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.
-