com.infomancers.collections.iterators
Class StringIterators

java.lang.Object
  extended by com.infomancers.collections.iterators.StringIterators

public final class StringIterators
extends java.lang.Object

Used to iterate strings and string searches in a friendly way.


Constructor Summary
StringIterators()
           
 
Method Summary
static java.lang.Iterable<java.lang.String> regexMatches(java.lang.CharSequence target, java.util.regex.Pattern pattern)
          Used to iterate over the matches of a pattern in a character sequence.
static java.lang.Iterable<java.lang.String> stringTokenizerIterable(java.util.StringTokenizer tokenizer)
          Used to iterate over the tokens in a StringTokenizer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringIterators

public StringIterators()
Method Detail

regexMatches

public static java.lang.Iterable<java.lang.String> regexMatches(java.lang.CharSequence target,
                                                                java.util.regex.Pattern pattern)
Used to iterate over the matches of a pattern in a character sequence.

Parameters:
target - The character sequence.
pattern - The pattern to match.
Returns:
An iteration of all matched strings inside the character sequence.

stringTokenizerIterable

public static java.lang.Iterable<java.lang.String> stringTokenizerIterable(java.util.StringTokenizer tokenizer)
Used to iterate over the tokens in a StringTokenizer.

Parameters:
tokenizer - The tokenizer to iterate over.
Returns:
An iteration of all result strings.
See Also:
StringTokenizer