org.xerial.mlpress
Class TagStructureEncoder

java.lang.Object
  extended by org.xerial.mlpress.TagStructureEncoder

public class TagStructureEncoder
extends Object

The TagStructureEncoder repraces tag structures in XML documents to shorter representations by using tagIDs. For example, consider the following XML document:

 
 
   helloworld.txt
   2005/07/24
   
      UTF-8
       ... 
   
 
 
   world.png
   .....
 
 
 
It will be encoded as follows:
 1 2 3 C3 / 4 C4 / 5 6 C6 / 7 C7 / / / 2 8 C8 3 C3 / 9 C9 / 10 C10 / / / $ 
 
where the above integers denote IDs of the start tag names. '/' is end tag, C? (? is an integer) is text container ID, and '$' is the end-of-file. To distinguish IDs of tag names and attribute names is the role of TagDictionary, Thus the TagStructureEncoder simply encodes attribute elements,

Author:
leo

Constructor Summary
TagStructureEncoder(TagDictionary tagDict)
           
 
Method Summary
 VariableLengthInteger closeTag()
           
 VariableLengthInteger encodeAttribute(String tagName, String attributeName)
           
 VariableLengthInteger encodeTag(String tagName)
           
 VariableLengthInteger encodeWhiteSpace()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagStructureEncoder

public TagStructureEncoder(TagDictionary tagDict)
Method Detail

encodeTag

public VariableLengthInteger encodeTag(String tagName)

encodeWhiteSpace

public VariableLengthInteger encodeWhiteSpace()

closeTag

public VariableLengthInteger closeTag()

encodeAttribute

public VariableLengthInteger encodeAttribute(String tagName,
                                             String attributeName)


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.