EXIficient

com.siemens.ct.exi.datatype.stringtable
Class StringTableEncoderImpl

java.lang.Object
  extended by com.siemens.ct.exi.datatype.stringtable.AbstractStringTable
      extended by com.siemens.ct.exi.datatype.stringtable.StringTableEncoderImpl
All Implemented Interfaces:
StringTableCommon, StringTableEncoder
Direct Known Subclasses:
StringTableEncoderImplNoGlobalValues

public class StringTableEncoderImpl
extends AbstractStringTable
implements StringTableEncoder

TODO Description

Version:
0.3.20080915
Author:
Daniel.Peintner.EXT@siemens.com, Joerg.Heuer@siemens.com

Constructor Summary
StringTableEncoderImpl(boolean isSchemaInformed)
          The constructor will set all tables to their initial states.
 
Method Summary
 void addGlobalValue(java.lang.String value)
          Add a string value to the global value table.
 void addLocalName(java.lang.String uri, java.lang.String name)
          Add a name to the local name table.
 void addLocalValue(java.lang.String uri, java.lang.String localName, java.lang.String value)
          Add a value to the local value table.
 void addPrefix(java.lang.String uri, java.lang.String prefix)
          Add a prefix to the namespace prefix table.
 void addURI(java.lang.String uri)
          Add a URI to the URI table.
 int getGlobalValueID(java.lang.String value)
          Get the ID (index) of the given value in the global value table.
 int getGlobalValueTableSize()
          Get the current size the global value table.
 int getLocalNameID(java.lang.String uri, java.lang.String name)
          Get identifier for a given URI/localName pair.
 int getLocalNameTableSize(java.lang.String uri)
          Get size of the local name table partition for a given URI.
 int getLocalValueID(java.lang.String uri, java.lang.String localName, java.lang.String value)
          Get identifier for a given QName/localValue pair.
 int getLocalValueTableSize(java.lang.String uri, java.lang.String localName)
          Get size of the localName table partition identified by QName.
 int getPrefixID(java.lang.String uri, java.lang.String prefix)
          Get identifier for a given URI/prefix pair.
 int getPrefixTableSize(java.lang.String uri)
          Get the size of the prefix table partition identified by URI.
 int getURIID(java.lang.String uri)
          Get the ID (index) of the given URI in the URI table.
 int getURITableSize()
          Get the size of the URI table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTableEncoderImpl

public StringTableEncoderImpl(boolean isSchemaInformed)
The constructor will set all tables to their initial states. This includes loading the partitions with inital values.

Method Detail

getURIID

public int getURIID(java.lang.String uri)
Description copied from interface: StringTableEncoder
Get the ID (index) of the given URI in the URI table.

Specified by:
getURIID in interface StringTableEncoder
Parameters:
uri - - URI value to look up.
Returns:
Index of the item or -1 if not found.

getPrefixID

public int getPrefixID(java.lang.String uri,
                       java.lang.String prefix)
Description copied from interface: StringTableEncoder
Get identifier for a given URI/prefix pair.

Specified by:
getPrefixID in interface StringTableEncoder
Parameters:
uri - - Namespace URI.
prefix - - Namespace prefix.
Returns:
- Index (ID) of prefix in table.

getLocalNameID

public int getLocalNameID(java.lang.String uri,
                          java.lang.String name)
Description copied from interface: StringTableEncoder
Get identifier for a given URI/localName pair.

Specified by:
getLocalNameID in interface StringTableEncoder
Parameters:
uri - - Namespace URI.
name - - Local name.
Returns:
- Index (ID) of prefix in table.

getLocalValueID

public int getLocalValueID(java.lang.String uri,
                           java.lang.String localName,
                           java.lang.String value)
Description copied from interface: StringTableEncoder
Get identifier for a given QName/localValue pair.

Specified by:
getLocalValueID in interface StringTableEncoder
Parameters:
uri - - namespace URI
localName - - local-name
value - - String value to look up.
Returns:
- Index (ID) of value in table.

getGlobalValueID

public int getGlobalValueID(java.lang.String value)
Description copied from interface: StringTableEncoder
Get the ID (index) of the given value in the global value table.

Specified by:
getGlobalValueID in interface StringTableEncoder
Parameters:
value - - Value to look up.
Returns:
Index of the item or -1 if not found.

addURI

public void addURI(java.lang.String uri)
Description copied from interface: StringTableCommon
Add a URI to the URI table.

Specified by:
addURI in interface StringTableCommon
Parameters:
uri - - URI to be added.

getURITableSize

public int getURITableSize()
Description copied from interface: StringTableCommon
Get the size of the URI table.

Specified by:
getURITableSize in interface StringTableCommon

addPrefix

public void addPrefix(java.lang.String uri,
                      java.lang.String prefix)
Description copied from interface: StringTableCommon
Add a prefix to the namespace prefix table.

Specified by:
addPrefix in interface StringTableCommon
Parameters:
uri - - Namespace URI.
prefix - - Namespace prefix to be added.

getPrefixTableSize

public int getPrefixTableSize(java.lang.String uri)
Description copied from interface: StringTableCommon
Get the size of the prefix table partition identified by URI.

Specified by:
getPrefixTableSize in interface StringTableCommon
Parameters:
uri - - Namespace URI.
Returns:
- Current number of items (strings) in the table.

addLocalName

public void addLocalName(java.lang.String uri,
                         java.lang.String name)
Description copied from interface: StringTableCommon
Add a name to the local name table.

Specified by:
addLocalName in interface StringTableCommon
Parameters:
uri - - Namespace URI.
name - - Name to be added.

getLocalNameTableSize

public int getLocalNameTableSize(java.lang.String uri)
Description copied from interface: StringTableCommon
Get size of the local name table partition for a given URI.

Specified by:
getLocalNameTableSize in interface StringTableCommon
Parameters:
uri - - Namespace URI.
Returns:
- Number of items (strings) in the table.

addLocalValue

public void addLocalValue(java.lang.String uri,
                          java.lang.String localName,
                          java.lang.String value)
Description copied from interface: StringTableCommon
Add a value to the local value table.

Specified by:
addLocalValue in interface StringTableCommon
Parameters:
uri - - Namespace URI
localName - - local-name
value - - String value to be added.

getLocalValueTableSize

public int getLocalValueTableSize(java.lang.String uri,
                                  java.lang.String localName)
Description copied from interface: StringTableCommon
Get size of the localName table partition identified by QName.

Specified by:
getLocalValueTableSize in interface StringTableCommon
Parameters:
uri - - Namespace URI
localName - - local-name
Returns:
- Number of items (strings) in table.

addGlobalValue

public void addGlobalValue(java.lang.String value)
Description copied from interface: StringTableCommon
Add a string value to the global value table.

Specified by:
addGlobalValue in interface StringTableCommon
Parameters:
value - - Value to be added.

getGlobalValueTableSize

public int getGlobalValueTableSize()
Description copied from interface: StringTableCommon
Get the current size the global value table.

Specified by:
getGlobalValueTableSize in interface StringTableCommon
Returns:
Number of items (strings) in the table.

EXIficient