BitapSearchProcessorFactory Class — netty Architecture
Architecture documentation for the BitapSearchProcessorFactory class in BitapSearchProcessorFactory.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD bd670f33_27c2_da7c_4505_653780f3b127["BitapSearchProcessorFactory"] 298973b5_8562_0860_be3e_d82e75eda59a["BitapSearchProcessorFactory.java"] bd670f33_27c2_da7c_4505_653780f3b127 -->|defined in| 298973b5_8562_0860_be3e_d82e75eda59a e98dbb4c_bb5f_ad68_db8e_31c85d989c9c["BitapSearchProcessorFactory()"] bd670f33_27c2_da7c_4505_653780f3b127 -->|method| e98dbb4c_bb5f_ad68_db8e_31c85d989c9c 9d4cb2a2_278d_29e7_2b8b_e9ffd1a2d289["Processor()"] bd670f33_27c2_da7c_4505_653780f3b127 -->|method| 9d4cb2a2_278d_29e7_2b8b_e9ffd1a2d289
Relationship Graph
Source Code
buffer/src/main/java/io/netty/buffer/search/BitapSearchProcessorFactory.java lines 27–77
public class BitapSearchProcessorFactory extends AbstractSearchProcessorFactory {
private final long[] bitMasks = new long[256];
private final long successBit;
public static class Processor implements SearchProcessor {
private final long[] bitMasks;
private final long successBit;
private long currentMask;
Processor(long[] bitMasks, long successBit) {
this.bitMasks = bitMasks;
this.successBit = successBit;
}
@Override
public boolean process(byte value) {
currentMask = ((currentMask << 1) | 1) & PlatformDependent.getLong(bitMasks, value & 0xffL);
return (currentMask & successBit) == 0;
}
@Override
public void reset() {
currentMask = 0;
}
}
BitapSearchProcessorFactory(byte[] needle) {
if (needle.length > 64) {
throw new IllegalArgumentException("Maximum supported search pattern length is 64, got " + needle.length);
}
long bit = 1L;
for (byte c: needle) {
bitMasks[c & 0xff] |= bit;
bit <<= 1;
}
successBit = 1L << (needle.length - 1);
}
/**
* Returns a new {@link Processor}.
*/
@Override
public Processor newSearchProcessor() {
return new Processor(bitMasks, successBit);
}
}
Source
Frequently Asked Questions
What is the BitapSearchProcessorFactory class?
BitapSearchProcessorFactory is a class in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/search/BitapSearchProcessorFactory.java.
Where is BitapSearchProcessorFactory defined?
BitapSearchProcessorFactory is defined in buffer/src/main/java/io/netty/buffer/search/BitapSearchProcessorFactory.java at line 27.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free