Class HybridBitSetMatcher


public final class HybridBitSetMatcher extends InvertibleCharMatcher
Character matcher that compiles to a binary search in a sorted list of ranges, like RangeTreeMatcher, but replaces some subtrees with bit-set matches. Specifically, if the character set contains many short ranges that differ only in the lowest byte, those ranges are converted to a bit-set, which is checked when the binary search finds that the given character is in the byte range denoted by the bit set. The threshold for bit-set conversion is defined by TRegexOptions.TRegexRangeToBitSetConversionThreshold. Example:
 Character set:
 [0x02, 0x04, 0x06, 0x1000, 0x1020-0x1030]

 Resulting Hybrid matcher with threshold = 3:
 - ranges:   [0x02-0x06,          0x1000, 0x1020-0x1030]
 - bit-sets: [[0x02, 0x04, 0x06], null,   null         ]
 
See Also:
  • Method Details