ix.util
Class JavaNameWordIterator
java.lang.Object
ix.util.JavaNameWordIterator
- All Implemented Interfaces:
- java.util.Iterator
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
|
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 |
name
java.lang.String name
from
int from
at
int at
len
int len
JavaNameWordIterator
public JavaNameWordIterator(java.lang.String name)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator
next
public java.lang.Object next()
- Specified by:
next
in interface java.util.Iterator
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator
main
public static void main(java.lang.String[] argv)
- Test loop.