DomainTrie class

A Trie (prefix tree) data structure optimized for domain matching.

This implementation stores domains in reverse order (e.g., "com.example.ads") to enable efficient subdomain matching. Lookups are O(k) where k is the domain length, compared to O(n) for linear search.

Constructors

DomainTrie()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
Returns whether the trie is empty
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int
Returns the number of domains in the trie
no setter

Methods

clear() → void
Clears all domains from the trie
contains(String domain) → bool
Checks if a domain or any of its parent domains are in the trie
containsExact(String domain) → bool
Checks if an exact domain is in the trie (no subdomain matching)
insert(String domain) → void
Inserts a domain into the trie
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String domain) → bool
Removes a domain from the trie
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited