Home / Function/ linkSuffixes() — netty Function Reference

linkSuffixes() — netty Function Reference

Architecture documentation for the linkSuffixes() function in AhoCorasicSearchProcessorFactory.java from the netty codebase.

Function java Buffer Search called by 1

Entity Profile

Dependency Diagram

graph TD
  bef56ec2_3d63_5fe3_0a4b_a27b45c2ff42["linkSuffixes()"]
  2bbcf65c_43ea_8f43_fbbd_a4d039d021d0["AhoCorasicSearchProcessorFactory"]
  bef56ec2_3d63_5fe3_0a4b_a27b45c2ff42 -->|defined in| 2bbcf65c_43ea_8f43_fbbd_a4d039d021d0
  271ca4a7_3cd9_b2d2_1cc9_1936872f5be2["AhoCorasicSearchProcessorFactory()"]
  271ca4a7_3cd9_b2d2_1cc9_1936872f5be2 -->|calls| bef56ec2_3d63_5fe3_0a4b_a27b45c2ff42
  style bef56ec2_3d63_5fe3_0a4b_a27b45c2ff42 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/search/AhoCorasicSearchProcessorFactory.java lines 147–181

    private void linkSuffixes() {

        Queue<Integer> queue = new ArrayDeque<Integer>();
        queue.add(0);

        int[] suffixLinks = new int[matchForNeedleId.length];
        Arrays.fill(suffixLinks, -1);

        while (!queue.isEmpty()) {

            final int v = queue.remove();
            int vPosition = v >> BITS_PER_SYMBOL;
            final int u = suffixLinks[vPosition] == -1 ? 0 : suffixLinks[vPosition];

            if (matchForNeedleId[vPosition] == -1) {
                matchForNeedleId[vPosition] = matchForNeedleId[u >> BITS_PER_SYMBOL];
            }

            for (int ch = 0; ch < ALPHABET_SIZE; ch++) {

                final int vIndex = v | ch;
                final int uIndex = u | ch;

                final int jumpV = jumpTable[vIndex];
                final int jumpU = jumpTable[uIndex];

                if (jumpV != -1) {
                    suffixLinks[jumpV >> BITS_PER_SYMBOL] = v > 0 && jumpU != -1 ? jumpU : 0;
                    queue.add(jumpV);
                } else {
                    jumpTable[vIndex] = jumpU != -1 ? jumpU : 0;
                }
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does linkSuffixes() do?
linkSuffixes() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/search/AhoCorasicSearchProcessorFactory.java.
Where is linkSuffixes() defined?
linkSuffixes() is defined in buffer/src/main/java/io/netty/buffer/search/AhoCorasicSearchProcessorFactory.java at line 147.
What calls linkSuffixes()?
linkSuffixes() is called by 1 function(s): AhoCorasicSearchProcessorFactory.

Analyze Your Own Codebase

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

Try Supermodel Free