Xindice API
version 1.2m1

org.apache.xindice.xml
Class SymbolTable

java.lang.Object
  extended byorg.apache.xindice.xml.SymbolTable
All Implemented Interfaces:
XMLSerializable
Direct Known Subclasses:
SymbolTableSymbols

public class SymbolTable
extends Object
implements XMLSerializable

SymbolTable is a class that allows the Xindice Compression system to resolve symbol IDs in compression/decompression passes.

Version:
$Revision: 568786 $, $Date: 2007-08-22 20:40:57 -0400 (Wed, 22 Aug 2007) $

Nested Class Summary
static class SymbolTable.SymbolInfo
           
 
Constructor Summary
SymbolTable()
           
SymbolTable(org.w3c.dom.Element symbols)
           
SymbolTable(org.w3c.dom.Element symbols, boolean readOnly)
           
 
Method Summary
 long getLastModified()
           
 String getName(short symbol)
           
 String getNamespaceURI(short symbol)
           
 short getNormalizedSymbol(String lookup, NamespaceMap nsMap, boolean create)
          Lookup normalized symbol by lookup string and (optional) namespace map.
 short getNormalizedSymbol(String localName, String namespaceURI)
           
 short getNormalizedSymbol(String localName, String namespaceURI, boolean create)
          Lookup normalized symbol by element (or attribute) local name and namespace URI.
 short getSymbol(String qname)
           
 short getSymbol(String qname, boolean create)
           
 short getSymbol(String qname, String namespaceURI)
           
 short getSymbol(String qname, String namespaceURI, boolean create)
           
 SymbolTable.SymbolInfo getSymbolInfo(short symbol)
           
 boolean isDirty()
           
 boolean isReadOnly()
           
 void resetDirty()
          Reset dirty flag to false.
 void streamFromXML(org.w3c.dom.Element element)
          streamFromXML streams an object from the DOM node.
 org.w3c.dom.Element streamToXML(org.w3c.dom.Document doc)
          streamToXML streams a Java object to the DOM node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolTable

public SymbolTable()

SymbolTable

public SymbolTable(org.w3c.dom.Element symbols)

SymbolTable

public SymbolTable(org.w3c.dom.Element symbols,
                   boolean readOnly)
Method Detail

isDirty

public final boolean isDirty()
Returns:
true if symbol table has been modified

resetDirty

public final void resetDirty()
Reset dirty flag to false. Should be invoked once symbol table is successfully saved.


getLastModified

public final long getLastModified()

isReadOnly

public final boolean isReadOnly()
Returns:
true if symbol table is read only

getSymbolInfo

public final SymbolTable.SymbolInfo getSymbolInfo(short symbol)

getNamespaceURI

public final String getNamespaceURI(short symbol)

getName

public final String getName(short symbol)

getSymbol

public final short getSymbol(String qname)

getSymbol

public final short getSymbol(String qname,
                             String namespaceURI)

getSymbol

public final short getSymbol(String qname,
                             boolean create)
                      throws ReadOnlyException
Throws:
ReadOnlyException

getSymbol

public final short getSymbol(String qname,
                             String namespaceURI,
                             boolean create)
                      throws ReadOnlyException
Throws:
ReadOnlyException

getNormalizedSymbol

public final short getNormalizedSymbol(String localName,
                                       String namespaceURI)

getNormalizedSymbol

public final short getNormalizedSymbol(String localName,
                                       String namespaceURI,
                                       boolean create)
                                throws ReadOnlyException
Lookup normalized symbol by element (or attribute) local name and namespace URI.

Parameters:
localName - element (attribute) local name
namespaceURI - element (attribute) namespace URI
create - when true, creates symbol if it is missing
Returns:
symbol id or -1
Throws:
ReadOnlyException - if 'create' option specified and the symbol is missing

getNormalizedSymbol

public final short getNormalizedSymbol(String lookup,
                                       NamespaceMap nsMap,
                                       boolean create)
                                throws ReadOnlyException
Lookup normalized symbol by lookup string and (optional) namespace map. Lookup string can take one of the following forms: Namespace map is used to determine namespaceURI for passed in lookup string and normalize namespace prefix.

Parameters:
lookup - lookup string
nsMap - namespace map
create - when true, creates symbol if it is missing
Returns:
symbol id or -1
Throws:
ReadOnlyException - if 'create' option specified and the symbol is missing

streamToXML

public final org.w3c.dom.Element streamToXML(org.w3c.dom.Document doc)
                                      throws org.w3c.dom.DOMException
Description copied from interface: XMLSerializable
streamToXML streams a Java object to the DOM node. Passed owner document is used to create nodes and should not be modified.

Specified by:
streamToXML in interface XMLSerializable
Parameters:
doc - The Owner Document
Returns:
A newly created Element
Throws:
org.w3c.dom.DOMException - If an error occurs

streamFromXML

public final void streamFromXML(org.w3c.dom.Element element)
                         throws org.w3c.dom.DOMException
Description copied from interface: XMLSerializable
streamFromXML streams an object from the DOM node.

Specified by:
streamFromXML in interface XMLSerializable
Parameters:
element - The Input Element
Throws:
org.w3c.dom.DOMException - If an error occurs

Xindice API
version 1.2m1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.