Class PublicSuffixes.Node
java.lang.Object
org.archive.net.PublicSuffixes.Node
- All Implemented Interfaces:
Comparable<PublicSuffixes.Node>
- Enclosing class:
PublicSuffixes
prefix tree node. each Node represents sequence of letters (prefix)
and alternative sequences following it (list of Node's). Nodes in
branches are sorted for skip list like lookup and for generating
effective regular expression (see compareTo(Node) and compareTo(char).
as is intended for internal use only, there's no access methods. procedures for updating
prefix tree with new input are defined within this class (addBranch(CharSequence)).
terminal node could be represented in two different form: 1) Node with zero branches,
or 2) Node with zero-length cs. So, root node must be initialized with empty (not null)
branches unless empty string matches the overall pattern.
cs must not be null except for root node.- Author:
- Gojomo this version of PublicSuffixes uses suffix-tree data structure for generating less redundant regular expression. It may be even possible to write a light-weight, thread-safe matcher based on this class., Kenji Nagahashi
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionNode()protectedNode(CharSequence cs) protectedNode(CharSequence cs, List<PublicSuffixes.Node> branches) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(CharSequence s) voidintcompareTo(char oc) intcompareTo(PublicSuffixes.Node other)
-
Field Details
-
cs
-
branches
-
-
Constructor Details
-
Node
public Node() -
Node
-
Node
-
-
Method Details
-
addBranch
-
add
-
compareTo
- Specified by:
compareToin interfaceComparable<PublicSuffixes.Node>
-
compareTo
public int compareTo(char oc)
-