f00f.net.irc.martyr.util
Class ParameterIterator

java.lang.Object
  extended by f00f.net.irc.martyr.util.ParameterIterator
All Implemented Interfaces:
java.util.Iterator

public class ParameterIterator
extends java.lang.Object
implements java.util.Iterator

This class iterates over the parameter string of an IRC command, returning each parameter in order as next() is called. This class also knows about the ":" parameters, which is the large string at the end of most commands, and treats it specially.


Constructor Summary
ParameterIterator(java.lang.String paramStr)
           
 
Method Summary
 boolean hasNext()
           
 java.lang.String last()
          Forwards the iterator to the last element and returns it.
 java.lang.Object next()
           
 boolean nextIsLast()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterIterator

public ParameterIterator(java.lang.String paramStr)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there are more parameters, and false otherwise.

nextIsLast

public boolean nextIsLast()
Returns:
true if the next parameter is also the ":" parameter.
Throws:
java.util.NoSuchElementException - if there are no more params

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator
Throws:
java.util.NoSuchElementException - if there are no more params

last

public java.lang.String last()
Forwards the iterator to the last element and returns it. The "last" parameter should be the ":" parameter.

Returns:
Last parameter

remove

public void remove()
Specified by:
remove in interface java.util.Iterator


Copyright © 2000-2007 Ben Damm, Daniel Henninger, et al.