lux.index
Class XPathValueMapper

java.lang.Object
  extended by lux.index.XmlPathMapper
      extended by lux.index.XPathValueMapper
All Implemented Interfaces:
StAXHandler

public class XPathValueMapper
extends XmlPathMapper

Each path-value is a string of path components, as defined in XmlPathMapper, followed by a value token. Element and attribute string values are represented by 8-character hashes of their first N characters. If the value fits in 8 characters, it is padded with nulls (unicode 0). The hash algorithm is analogous to that used by java.lang.String, but arithmetic is done with shorts rather than ints, and we keep more of them so that the likelihood of collisions is very small.


Field Summary
static int HASH_SIZE
           
 
Fields inherited from class lux.index.XmlPathMapper
currentPath, currentQName
 
Constructor Summary
XPathValueMapper()
           
 
Method Summary
 ArrayList<char[]> getPathValues()
           
 void handleEvent(XMLStreamReader reader, int eventType)
          This method receives StAX events.
static char[] hashString(char[] value, char[] buf)
           
 void reset()
          reinitialize any internal state and prepare the handler for re-use
 
Methods inherited from class lux.index.XmlPathMapper
encodeQName, getAttQNameCounts, getEltQNameCounts, getEventAttQName, getPathCounts, isNamespaceAware, setNamespaceAware
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HASH_SIZE

public static final int HASH_SIZE
See Also:
Constant Field Values
Constructor Detail

XPathValueMapper

public XPathValueMapper()
Method Detail

getPathValues

public ArrayList<char[]> getPathValues()

reset

public void reset()
Description copied from interface: StAXHandler
reinitialize any internal state and prepare the handler for re-use

Specified by:
reset in interface StAXHandler
Overrides:
reset in class XmlPathMapper

handleEvent

public void handleEvent(XMLStreamReader reader,
                        int eventType)
Description copied from interface: StAXHandler
This method receives StAX events. It should never call XMLStreamReader.next() since if it does, its caller will miss the event.

Specified by:
handleEvent in interface StAXHandler
Overrides:
handleEvent in class XmlPathMapper
Parameters:
reader - the reader from which events are being read
eventType - the XML stream event type

hashString

public static char[] hashString(char[] value,
                                char[] buf)


Copyright © 2013. All Rights Reserved.