com.sun.jersey.server.impl.uri.rules.automata
Class TrieNode<T>

java.lang.Object
  extended by com.sun.jersey.server.impl.uri.rules.automata.TrieNode<T>

public final class TrieNode<T>
extends Object

Represents a trie automata node.

Author:
Frank D. Martinez. fmartinez@asimovt.com

Field Summary
static Pattern PARAMETER_PATTERN
          TemplateParameters pattern regexp.
 
Constructor Summary
protected TrieNode()
          Creates a new instance of TrieNode
protected TrieNode(T value)
          Creates a new instance of TrieNode
 
Method Summary
protected  void add(String path, T value, UriPattern pattern)
          Adds a new node to the tree.
 int getArcs()
          arcs getter.
protected  TrieArc<T> getFirstArc()
          firstArch getter.
 UriPattern getPattern()
          pattern getter.
 Iterator<T> getValue()
          value getter.
protected  boolean hasValue()
          Tells if there is a value in this node.
protected  boolean isWildcard()
          wildcard getter.
protected  TrieArc<T> matchExitArc(CharSequence seq, int i)
          Search for a matching escape character in a wildcard sequence.
 void pack()
          Pack and optimize the automata.
protected  void setValue(T value, UriPattern pattern)
          value setter.
protected  void setWildcard(boolean b)
          wildcard setter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_PATTERN

public static final Pattern PARAMETER_PATTERN
TemplateParameters pattern regexp.

Constructor Detail

TrieNode

protected TrieNode()
Creates a new instance of TrieNode


TrieNode

protected TrieNode(T value)
Creates a new instance of TrieNode

Parameters:
value - Initial value.
Method Detail

setWildcard

protected void setWildcard(boolean b)
wildcard setter.

Parameters:
b - New wildcard value.

setValue

protected void setValue(T value,
                        UriPattern pattern)
value setter.

Parameters:
value - New value.
template - Associated template.

matchExitArc

protected TrieArc<T> matchExitArc(CharSequence seq,
                                  int i)
Search for a matching escape character in a wildcard sequence.

Parameters:
c - Test char.

hasValue

protected boolean hasValue()
Tells if there is a value in this node.


add

protected void add(String path,
                   T value,
                   UriPattern pattern)
Adds a new node to the tree.

Parameters:
path - Matching URI
value - Value to be added.
template - Associated UriPattern.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getPattern

public UriPattern getPattern()
pattern getter.


getValue

public Iterator<T> getValue()
value getter.


isWildcard

protected boolean isWildcard()
wildcard getter.


getFirstArc

protected TrieArc<T> getFirstArc()
firstArch getter.


getArcs

public int getArcs()
arcs getter.


pack

public void pack()
Pack and optimize the automata.



Copyright © 2013 Oracle Corporation. All Rights Reserved.