org.apache.shale.clay.parser
Class NodeTokenizer

java.lang.Object
  extended by org.apache.shale.clay.parser.NodeTokenizer

public class NodeTokenizer
extends Object

Splits a document into tokens using the following delimiters "<>". The tokens are represented by a starting and ending offset so a bunch of strings are not created until the content is needed.


Constructor Summary
NodeTokenizer(StringBuffer buffer)
           Constructor with the complete document to parse.
 
Method Summary
protected  void index(ArrayList tokenIndex)
           This method is passed an empty ArrayList that should be populated into Token offsets.
 Iterator iterator()
          Returns an implementation of the Iterator interface to enumerate the nodes within the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeTokenizer

public NodeTokenizer(StringBuffer buffer)

Constructor with the complete document to parse.

Parameters:
buffer - document
Method Detail

index

protected void index(ArrayList tokenIndex)

This method is passed an empty ArrayList that should be populated into Token offsets.

Parameters:
tokenIndex - all the document tokens

iterator

public Iterator iterator()

Returns an implementation of the Iterator interface to enumerate the nodes within the document. Each node is defined using a Token interface.

Returns:
TokenIterator


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.