net.sf.jga.util
Class StringTokenizerIterator
java.lang.Object
net.sf.jga.util.StringTokenizerIterator
- All Implemented Interfaces:
- java.lang.Iterable<java.lang.String>, java.util.Iterator<java.lang.String>
public class StringTokenizerIterator
- extends java.lang.Object
- implements java.util.Iterator<java.lang.String>, java.lang.Iterable<java.lang.String>
Adapts a StringTokenizer to the Iterator interface.
Copyright © 2003-2005 David A. Hall
- Author:
- David A. Hall
Method Summary |
boolean |
hasNext()
Returns true if the base tokenizer has tokens remaining. |
java.util.Iterator<java.lang.String> |
iterator()
|
java.lang.String |
next()
Returns the next string in the base tokenizer. |
void |
remove()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringTokenizerIterator
public StringTokenizerIterator(java.lang.String str)
StringTokenizerIterator
public StringTokenizerIterator(java.lang.String str,
java.lang.String delim)
StringTokenizerIterator
public StringTokenizerIterator(java.util.StringTokenizer tok)
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<java.lang.String>
hasNext
public boolean hasNext()
- Returns true if the base tokenizer has tokens remaining.
- Specified by:
hasNext
in interface java.util.Iterator<java.lang.String>
next
public java.lang.String next()
- Returns the next string in the base tokenizer.
- Specified by:
next
in interface java.util.Iterator<java.lang.String>
- Throws:
java.util.NoSuchElementException
- if there are no more tokens in the base
tokenizer's string
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator<java.lang.String>
Copyright © 2002-2006 David A. Hall. All Rights Reserved.