|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.asn1.ber.digester.TagTree
A disjointed tree of tag patterns with and without wild cards.
Field Summary | |
private java.util.HashMap |
normNodes
a map of tag nodes for normal patterns |
private java.util.ArrayList |
normRegistrations
the list of normal rule regs with rule and pattern in order |
static int |
WILDCARD
the wild card tag value as an integer = UNIVERSAL 2,097,151 (2^21-1) |
private java.util.HashMap |
wildNodes
a map of tag nodes for wild carded patterns |
private java.util.ArrayList |
wildRegistrations
the list of wild carded rule regs with rule and pattern in order |
Constructor Summary | |
TagTree()
|
Method Summary | |
private void |
addNormalRule(int[] pattern,
Rule rule)
Adds a Rule to this TagTree. |
void |
addRule(int[] pattern,
Rule rule)
Adds a Rule to this TagTree in a manner based on whether the pattern contains a wild card in front or not. |
private void |
addWildRule(int[] pattern,
Rule rule)
Adds a Rule using a pattern with a wild card in front to this TagTree. |
private void |
addWildRulesToNewNormalNode(TagNode node,
java.util.Stack stack)
Adds wild carded rules to new nodes being added to the tag tree with normal patterns without wild cards. |
private void |
addWildRuleToNormalTree(int[] pattern,
Rule rule,
java.util.Stack stack,
TagNode node)
Adds rules registered via wild cards to the nodes within a branch of the normal TagTree. |
private void |
addWildRuleToWildTree(int[] pattern,
Rule rule,
java.util.Stack stack,
TagNode node)
Adds rules registered via wild cards to the wild TagTree to all nodes matching the pattern. |
TagNode |
getNode(int[] pattern)
|
TagNode |
getNode(org.apache.commons.collections.primitives.IntStack stack)
|
private TagNode |
getNormalNode(int[] pattern)
|
private TagNode |
getNormalNode(org.apache.commons.collections.primitives.IntStack stack)
|
private TagNode |
getWildNode(int[] pattern)
Gets a node matching a pattern with a wild card from this TagTree. |
private TagNode |
getWildNode(org.apache.commons.collections.primitives.IntStack stack)
Gets a node matching a pattern with a wild card from this TagTree. |
private boolean |
isReverseTailMatch(int[] pattern,
java.util.Stack stack)
Called by depth first search used to add rules of wild card patterns to the wild TagTree. |
private boolean |
isTailMatch(int[] pattern,
java.util.Stack stack)
Called by depth first search used to add rules of wild card patterns to the normal TagTree. |
java.util.List |
match(int[] pattern)
|
java.util.List |
match(org.apache.commons.collections.primitives.IntStack stack)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int WILDCARD
private java.util.HashMap normNodes
private java.util.HashMap wildNodes
private java.util.ArrayList normRegistrations
private java.util.ArrayList wildRegistrations
Constructor Detail |
public TagTree()
Method Detail |
public void addRule(int[] pattern, Rule rule)
pattern
- the pattern of nested tagsrule
- the rule to add for the patternprivate void addNormalRule(int[] pattern, Rule rule)
pattern
- the pattern of nested tagsrule
- the rule to add for the patternprivate void addWildRule(int[] pattern, Rule rule)
pattern
- the pattern of nested tags with starting wild cardrule
- the rule to add for the patternprivate void addWildRulesToNewNormalNode(TagNode node, java.util.Stack stack)
node
- the new node added to the tree of normal tagsstack
- a stack of nodes encountered while walking the treeprivate void addWildRuleToWildTree(int[] pattern, Rule rule, java.util.Stack stack, TagNode node)
pattern
- the matching pattern with front wild cardrule
- the rule registered with the patternstack
- the stack storing the depth first nesting patternnode
- the current node scrutinized for a match by the pattern, and
the current position of the depth first searchprivate boolean isReverseTailMatch(int[] pattern, java.util.Stack stack)
pattern
- the pattern with a wild card at position 0stack
- the nesting stack representing the depth first search path
private void addWildRuleToNormalTree(int[] pattern, Rule rule, java.util.Stack stack, TagNode node)
pattern
- the matching pattern with front wild cardrule
- the rule registered with the patternstack
- the stack storing the depth first nesting patternnode
- the current node scrutinized for a match by the pattern, and
the current position of the depth first searchprivate boolean isTailMatch(int[] pattern, java.util.Stack stack)
pattern
- the pattern with a wild card at position 0stack
- the nesting stack representing the depth first search path
public java.util.List match(org.apache.commons.collections.primitives.IntStack stack)
public TagNode getNode(org.apache.commons.collections.primitives.IntStack stack)
public java.util.List match(int[] pattern)
public TagNode getNode(int[] pattern)
private TagNode getNormalNode(org.apache.commons.collections.primitives.IntStack stack)
private TagNode getNormalNode(int[] pattern)
private TagNode getWildNode(int[] pattern)
pattern
- the wild card pattern as an int array
private TagNode getWildNode(org.apache.commons.collections.primitives.IntStack stack)
stack
- the wild card pattern as a stack
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |