net.sf.mmm.util.xml.base
Class NodeValueCharIterator

java.lang.Object
  extended by net.sf.mmm.util.xml.base.NodeValueCharIterator
All Implemented Interfaces:
CharIterator

 class NodeValueCharIterator
extends Object
implements CharIterator

This is an implementation of CharIterator that iterates the characters of the value(s) of a single node or a node-list.

Since:
1.0.2
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  int nodeIndex
          The current index in nodeList.
private  NodeList nodeList
           
private  String value
          The current node-value.
private  int valueIndex
          The current index in value.
private  int valueLength
          The length of the current value.
 
Fields inherited from interface net.sf.mmm.util.lang.api.CharIterator
END_OF_ITERATOR
 
Constructor Summary
NodeValueCharIterator(Node singleNode)
          The constructor.
NodeValueCharIterator(NodeList nodeList)
          The constructor.
 
Method Summary
 boolean hasNext()
          This method determines whether there is a next char available or the end of this iterator has been reached.
 char next()
          This method returns the next character to iterate or CharIterator.END_OF_ITERATOR if the end of this iterator has been reached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeList

private final NodeList nodeList
See Also:
NodeValueCharIterator(NodeList)

nodeIndex

private int nodeIndex
The current index in nodeList.


value

private String value
The current node-value.


valueLength

private int valueLength
The length of the current value.


valueIndex

private int valueIndex
The current index in value.

Constructor Detail

NodeValueCharIterator

public NodeValueCharIterator(NodeList nodeList)
The constructor.

Parameters:
nodeList - is the NodeList containing the Nodes with the values to iterate char by char.

NodeValueCharIterator

public NodeValueCharIterator(Node singleNode)
The constructor.

Parameters:
singleNode - is the single Node with the value to iterate char by char.
Method Detail

hasNext

public boolean hasNext()
This method determines whether there is a next char available or the end of this iterator has been reached.

Specified by:
hasNext in interface CharIterator
Returns:
true if there is at least one next char available, or false if the end of this iterator has been reached and further calls of CharIterator.next() will return CharIterator.END_OF_ITERATOR.
See Also:
CharIterator.next(), Iterator.hasNext()

next

public char next()
This method returns the next character to iterate or CharIterator.END_OF_ITERATOR if the end of this iterator has been reached. If CharIterator.END_OF_ITERATOR is returned further calls will always return CharIterator.END_OF_ITERATOR.

Specified by:
next in interface CharIterator
Returns:
the next character or CharIterator.END_OF_ITERATOR if the end of this iterator has been reached.
See Also:
Iterator.next()


Copyright © 2001-2010 mmm-Team. All Rights Reserved.