Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » jasper » xmlparser » [javadoc | source]
org.apache.jasper.xmlparser
public class: SymbolTable [javadoc | source]
java.lang.Object
   org.apache.jasper.xmlparser.SymbolTable
This class is a symbol table implementation that guarantees that strings used as identifiers are unique references. Multiple calls to addSymbol will always return the same string reference.

The symbol table performs the same task as String.intern() with the following differences:

Nested Class Summary:
protected static final class  SymbolTable.Entry  This class is a symbol table entry. Each entry acts as a node in a linked list. 
Field Summary
protected static final  int TABLE_SIZE    Default table size. 
protected  SymbolTable.Entry[] fBuckets    Buckets. 
protected  int fTableSize     
Constructor:
 public SymbolTable() 
 public SymbolTable(int tableSize) 
Method from org.apache.jasper.xmlparser.SymbolTable Summary:
addSymbol,   addSymbol,   containsSymbol,   containsSymbol,   hash,   hash
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jasper.xmlparser.SymbolTable Detail:
 public String addSymbol(String symbol) 
    Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If the symbol already exists, the previous symbol reference is returned instead, in order guarantee that symbol references remain unique.
 public String addSymbol(char[] buffer,
    int offset,
    int length) 
    Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If the symbol already exists, the previous symbol reference is returned instead, in order guarantee that symbol references remain unique.
 public boolean containsSymbol(String symbol) 
    Returns true if the symbol table already contains the specified symbol.
 public boolean containsSymbol(char[] buffer,
    int offset,
    int length) 
    Returns true if the symbol table already contains the specified symbol.
 public int hash(String symbol) 
    Returns a hashcode value for the specified symbol. The value returned by this method must be identical to the value returned by the hash(char[],int,int) method when called with the character array that comprises the symbol string.
 public int hash(char[] buffer,
    int offset,
    int length) 
    Returns a hashcode value for the specified symbol information. The value returned by this method must be identical to the value returned by the hash(String) method when called with the string object created from the symbol information.