Top Description Inners Fields Constructors Methods
io.netty.buffer.search

public Class AhoCorasicSearchProcessorFactory

extends AbstractMultiSearchProcessorFactory
Class Inheritance
Imports
io.netty.util.internal.PlatformDependent, java.util.ArrayDeque, .ArrayList, .Arrays, .Queue

Implements Aho–Corasick string search algorithm. Use static AbstractMultiSearchProcessorFactory#newAhoCorasicSearchProcessorFactory to create an instance of this factory. Use AhoCorasicSearchProcessorFactory#newSearchProcessor to get an instance of io.netty.util.ByteProcessor implementation for performing the actual search.
See Also
AbstractMultiSearchProcessorFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
private final int[]
private final int[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static AhoCorasicSearchProcessorFactory.Context
buildTrie(byte[][] needles)

private void
public AhoCorasicSearchProcessorFactory.Processor
Inherited from io.netty.buffer.search.AbstractMultiSearchProcessorFactory:
newAhoCorasicSearchProcessorFactory

Field Detail

ALPHABET_SIZEback to summary
pack-priv static final int ALPHABET_SIZE
BITS_PER_SYMBOLback to summary
pack-priv static final int BITS_PER_SYMBOL
jumpTableback to summary
private final int[] jumpTable
matchForNeedleIdback to summary
private final int[] matchForNeedleId

Constructor Detail

AhoCorasicSearchProcessorFactoryback to summary
pack-priv AhoCorasicSearchProcessorFactory(byte[]... needles)

Method Detail

buildTrieback to summary
private static AhoCorasicSearchProcessorFactory.Context buildTrie(byte[][] needles)
linkSuffixesback to summary
private void linkSuffixes()
newSearchProcessorback to summary
public AhoCorasicSearchProcessorFactory.Processor newSearchProcessor()

Implements io.netty.buffer.search.MultiSearchProcessorFactory.newSearchProcessor.

Returns a new Processor.

Annotations
@Override
io.netty.buffer.search back to summary

private Class AhoCorasicSearchProcessorFactory.Context

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.buffer.search.AhoCorasicSearchProcessorFactory.Context

Field Summary

Modifier and TypeField and Description
pack-priv int[]
pack-priv int[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jumpTableback to summary
pack-priv int[] jumpTable
matchForNeedleIdback to summary
pack-priv int[] matchForNeedleId

Constructor Detail

Contextback to summary
private Context()
io.netty.buffer.search back to summary

public Class AhoCorasicSearchProcessorFactory.Processor

extends Object
implements MultiSearchProcessor
Class Inheritance
  • java.lang.Object
  • io.netty.buffer.search.AhoCorasicSearchProcessorFactory.Processor
All Implemented Interfaces
io.netty.buffer.search.MultiSearchProcessor, io.netty.buffer.search.SearchProcessor, io.netty.util.ByteProcessor

Field Summary

Modifier and TypeField and Description
private long
private final int[]
private final int[]

Constructor Summary

AccessConstructor and Description
pack-priv
Processor(int[] jumpTable, int[] matchForNeedleId)

Method Summary

Modifier and TypeMethod and Description
public int
public boolean
public void
reset()

Implements io.netty.buffer.search.SearchProcessor.reset.

Resets the state of SearchProcessor.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentPositionback to summary
private long currentPosition
jumpTableback to summary
private final int[] jumpTable
matchForNeedleIdback to summary
private final int[] matchForNeedleId

Constructor Detail

Processorback to summary
pack-priv Processor(int[] jumpTable, int[] matchForNeedleId)

Method Detail

getFoundNeedleIdback to summary
public int getFoundNeedleId()

Implements io.netty.buffer.search.MultiSearchProcessor.getFoundNeedleId.

Returns:int

Doc from io.netty.buffer.search.MultiSearchProcessor.getFoundNeedleId.

the index of found search string (if any, or -1 if none) at current position of this MultiSearchProcessor

Annotations
@Override
processback to summary
public boolean process(byte value)

Implements io.netty.util.ByteProcessor.process.

Returns:boolean

Doc from io.netty.util.ByteProcessor.process.

true if the processor wants to continue the loop and handle the next byte in the buffer. false if the processor wants to stop handling bytes and abort the loop.

Annotations
@Override
resetback to summary
public void reset()

Implements io.netty.buffer.search.SearchProcessor.reset.

Doc from io.netty.buffer.search.SearchProcessor.reset.

Resets the state of SearchProcessor.

Annotations
@Override