# eric7.WebBrowser.AdBlock.AdBlockSearchTree

Module implementing the AdBlock search tree.

### Global Attributes

None

### Classes

AdBlockSearchTree | Class implementing the AdBlock search tree.
AdBlockSearchTreeNode | Class implementing the AdBlock search tree node.

### Functions

None

## AdBlockSearchTree

Class implementing the AdBlock search tree.

### Derived from

None

### Class Attributes

None

### Class Methods

None

### Methods

AdBlockSearchTree | Constructor
__deleteNode | Private method to delete a search tree node.
__prefixSearch | Private method to perform a prefix search.
add | Public method to add a rule to the search tree.
clear | Public method to clear the search tree.
find | Public method to find a matching rule.

### Static Methods

None

#### AdBlockSearchTree (Constructor)

AdBlockSearchTree()

Constructor

#### AdBlockSearchTree.__deleteNode

__deleteNode(node)

Private method to delete a search tree node.

node (AdBlockSearchTreeNode)
  reference to the node to be deleted

#### AdBlockSearchTree.__prefixSearch

__prefixSearch(request, domain, urlString, string, length)

Private method to perform a prefix search.

request (QWebEngineUrlRequestInfo)
  URL request to be matched
domain (str)
  domain of the URL
urlString (str)
  requested URL as a lowercase string
string (str)
  prefix string to search for
length (int)
  length to be considered

Return:
  reference to the matched rule

Return Type:
  AdBlockRule

#### AdBlockSearchTree.add

add(rule)

Public method to add a rule to the search tree.

rule (AdBlockRule)
  rule to be added

Return:
  flag indicating a successful addition

Return Type:
  bool

#### AdBlockSearchTree.clear

clear()

Public method to clear the search tree.

#### AdBlockSearchTree.find

find(request, domain, urlString)

Public method to find a matching rule.

request (QWebEngineUrlRequestInfo)
  URL request to be matched
domain (str)
  domain of the URL
urlString (str)
  requested URL as a lowercase string

Return:
  reference to the matched rule

Return Type:
  AdBlockRule

Up

## AdBlockSearchTreeNode

Class implementing the AdBlock search tree node.

### Derived from

None

### Class Attributes

None

### Class Methods

None

### Methods

AdBlockSearchTreeNode | Constructor

### Static Methods

None

#### AdBlockSearchTreeNode (Constructor)

AdBlockSearchTreeNode()

Constructor

Up