Home / Class/ AbstractMultiSearchProcessorFactory Class — netty Architecture

AbstractMultiSearchProcessorFactory Class — netty Architecture

Architecture documentation for the AbstractMultiSearchProcessorFactory class in AbstractMultiSearchProcessorFactory.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d7246c9f_3bc6_3206_edb8_f42d8c43157b["AbstractMultiSearchProcessorFactory"]
  825c9483_7ff9_f9fe_5914_68dc7b2b3913["AbstractMultiSearchProcessorFactory.java"]
  d7246c9f_3bc6_3206_edb8_f42d8c43157b -->|defined in| 825c9483_7ff9_f9fe_5914_68dc7b2b3913
  d5f06afb_a439_ca98_94ea_6f2b95a681bd["AhoCorasicSearchProcessorFactory()"]
  d7246c9f_3bc6_3206_edb8_f42d8c43157b -->|method| d5f06afb_a439_ca98_94ea_6f2b95a681bd

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/search/AbstractMultiSearchProcessorFactory.java lines 69–94

public abstract class AbstractMultiSearchProcessorFactory implements MultiSearchProcessorFactory {

    /**
     * Creates a {@link MultiSearchProcessorFactory} based on
     * <a href="https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm">Aho–Corasick</a>
     * string search algorithm.
     * <br>
     * Precomputation (this method) time is linear in the size of input ({@code O(Σ|needles|)}).
     * <br>
     * The factory allocates and retains an array of 256 * X ints plus another array of X ints, where X
     * is the sum of lengths of each entry of {@code needles} minus the sum of lengths of repeated
     * prefixes of the {@code needles}.
     * <br>
     * Search (the actual application of {@link MultiSearchProcessor}) time is linear in the size of
     * {@link io.netty.buffer.ByteBuf} on which the search is performed ({@code O(|haystack|)}).
     * Every byte of {@link io.netty.buffer.ByteBuf} is processed only once, sequentually, regardles of
     * the number of {@code needles} being searched for.
     *
     * @param needles a varargs array of arrays of bytes to search for
     * @return a new instance of {@link AhoCorasicSearchProcessorFactory} precomputed for the given {@code needles}
     */
    public static AhoCorasicSearchProcessorFactory newAhoCorasicSearchProcessorFactory(byte[] ...needles) {
        return new AhoCorasicSearchProcessorFactory(needles);
    }

}

Frequently Asked Questions

What is the AbstractMultiSearchProcessorFactory class?
AbstractMultiSearchProcessorFactory is a class in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/search/AbstractMultiSearchProcessorFactory.java.
Where is AbstractMultiSearchProcessorFactory defined?
AbstractMultiSearchProcessorFactory is defined in buffer/src/main/java/io/netty/buffer/search/AbstractMultiSearchProcessorFactory.java at line 69.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free