FileDocCategorySizeDatePackage
SynchronizedSymbolTable.javaAPI DocJava SE 6 API3871Tue Jun 10 00:22:52 BST 2008com.sun.org.apache.xerces.internal.util

SynchronizedSymbolTable

public final class SynchronizedSymbolTable extends SymbolTable
Synchronized symbol table. This class moved into the util package since it's needed by multiple other classes (CachingParserPool, XMLGrammarCachingConfiguration).
author
Andy Clark, IBM
version
$Id: SynchronizedSymbolTable.java,v 1.2.6.1 2005/09/05 08:52:12 neerajbj Exp $

Fields Summary
protected SymbolTable
fSymbolTable
Main symbol table.
Constructors Summary
public SynchronizedSymbolTable(SymbolTable symbolTable)
Constructs a synchronized symbol table.

        fSymbolTable = symbolTable;
    
public SynchronizedSymbolTable()

        fSymbolTable = new SymbolTable();
    
public SynchronizedSymbolTable(int size)

        fSymbolTable = new SymbolTable(size);
    
Methods Summary
public java.lang.StringaddSymbol(java.lang.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.

param
symbol The new symbol.


        synchronized (fSymbolTable) {
            return fSymbolTable.addSymbol(symbol);
        }

    
public java.lang.StringaddSymbol(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.

param
buffer The buffer containing the new symbol.
param
offset The offset into the buffer of the new symbol.
param
length The length of the new symbol in the buffer.


        synchronized (fSymbolTable) {
            return fSymbolTable.addSymbol(buffer, offset, length);
        }

    
public booleancontainsSymbol(java.lang.String symbol)
Returns true if the symbol table already contains the specified symbol.

param
symbol The symbol to look for.


        synchronized (fSymbolTable) {
            return fSymbolTable.containsSymbol(symbol);
        }

    
public booleancontainsSymbol(char[] buffer, int offset, int length)
Returns true if the symbol table already contains the specified symbol.

param
buffer The buffer containing the symbol to look for.
param
offset The offset into the buffer.
param
length The length of the symbol in the buffer.


        synchronized (fSymbolTable) {
            return fSymbolTable.containsSymbol(buffer, offset, length);
        }