com.twelvemonkeys.util
Class AbstractTokenIterator

java.lang.Object
  extended by com.twelvemonkeys.util.AbstractTokenIterator
All Implemented Interfaces:
TokenIterator, Enumeration<String>, Iterator<String>
Direct Known Subclasses:
RegExTokenIterator, StringTokenIterator

public abstract class AbstractTokenIterator
extends Object
implements TokenIterator

Abstract base class for TokenIterators to extend.

Version:
$Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/AbstractTokenIterator.java#1 $
Author:
Harald Kuhr

Constructor Summary
AbstractTokenIterator()
           
 
Method Summary
 boolean hasMoreElements()
          This implementation simply returns hasNext().
 boolean hasMoreTokens()
           
 String nextElement()
          This implementation simply returns next().
 String nextToken()
          Returns the next element in the iteration as a String.
 void remove()
          Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.twelvemonkeys.util.TokenIterator
reset
 
Methods inherited from interface java.util.Iterator
hasNext, next
 

Constructor Detail

AbstractTokenIterator

public AbstractTokenIterator()
Method Detail

remove

public void remove()
Not supported.

Specified by:
remove in interface Iterator<String>
Throws:
UnsupportedOperationException - remove is not supported by this Iterator.

hasMoreTokens

public final boolean hasMoreTokens()
Specified by:
hasMoreTokens in interface TokenIterator

nextToken

public final String nextToken()
Returns the next element in the iteration as a String. This implementation simply returns (String) next().

Specified by:
nextToken in interface TokenIterator
Returns:
the next element in the iteration.
Throws:
NoSuchElementException - iteration has no more elements.
See Also:
Iterator.next()

hasMoreElements

public final boolean hasMoreElements()
This implementation simply returns hasNext().

Specified by:
hasMoreElements in interface Enumeration<String>
See Also:
Iterator.hasNext()

nextElement

public final String nextElement()
This implementation simply returns next().

Specified by:
nextElement in interface Enumeration<String>
See Also:
Iterator.next()


Copyright © 2015. All Rights Reserved.