Class JavaNameWordIterator

  extended by ix.util.JavaNameWordIterator
All Implemented Interfaces:

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

An iterator that returns successive words from a name that follows Java capitalization conventions.

The words are substrings of the name such that concatenating the words in order would result in a string equal to the original.

The words are normally the longest substrings that contain an an initial uppercase character followed by one or more non-uppercase characters. However, any sequence of uppercase characters before such a word (or reaching the end of name) is also taken as a word. For example:

    NameWordIterator: Name, Word, Iterator
    XML: XML
    XMLParser: XML, Parser
    AnXMLParser: An, XML, Parser
    SomeMoreXML: Some, More, XML

If the name begins with a non-uppercase character, the first word is everything up to just before the first uppercase char, or else, if no uppercase character occrs, the entire name.

Field Summary
(package private)  int at
(package private)  int from
(package private)  int len
(package private)  java.lang.String name
Constructor Summary
JavaNameWordIterator(java.lang.String name)
Method Summary
 boolean hasNext()
static void main(java.lang.String[] argv)
          Test loop.
 java.lang.Object next()
 void remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


java.lang.String name


int from


int at


int len
Constructor Detail


public JavaNameWordIterator(java.lang.String name)
Method Detail


public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator


public java.lang.Object next()
Specified by:
next in interface java.util.Iterator


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


public static void main(java.lang.String[] argv)
Test loop.