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

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

public class TrieArc<T>
extends Object

Represents an arc (transition) between trie nodes.

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

Field Summary
protected  char[] code
          Character that match this arc.
protected  TrieArc<T> next
          Next alternative node if this node does not match.
protected  TrieNode<T> target
          Target node at the end of this arc.
 
Constructor Summary
TrieArc(TrieNode<T> target, char code)
          Creates a new instance of TrieArc.
 
Method Summary
 int length()
          Number of characters to be consumed if this arc matches the input.
 int match(CharSequence seq, int i)
          Returns length() if this arc matches the input, 0 otherwise.
 void pack()
          Merge neighbour nodes if they are degenerated trees.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code

protected char[] code
Character that match this arc.


target

protected TrieNode<T> target
Target node at the end of this arc.


next

protected TrieArc<T> next
Next alternative node if this node does not match.

Constructor Detail

TrieArc

public TrieArc(TrieNode<T> target,
               char code)
Creates a new instance of TrieArc.

Parameters:
target - Target node at the end of this arc.
code - Matching character.
Method Detail

pack

public void pack()
Merge neighbour nodes if they are degenerated trees.


length

public int length()
Number of characters to be consumed if this arc matches the input.


match

public int match(CharSequence seq,
                 int i)
Returns length() if this arc matches the input, 0 otherwise.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Oracle Corporation. All Rights Reserved.