Build 1.0_r1(from source)

android.text
Class TextUtils.SimpleStringSplitter

java.lang.Object
  extended by android.text.TextUtils.SimpleStringSplitter
All Implemented Interfaces:
TextUtils.StringSplitter, Iterable<String>, Iterator<String>
Enclosing class:
TextUtils

public static class TextUtils.SimpleStringSplitter
extends Object
implements TextUtils.StringSplitter, Iterator<String>

A simple string splitter.

If the final character in the string to split is the delimiter then no empty string will be returned for the empty string after that delimeter. That is, splitting "a,b," on comma will return "a", "b", not "a", "b", "".


Constructor Summary
TextUtils.SimpleStringSplitter(char delimiter)
          Initializes the splitter.
 
Method Summary
 boolean hasNext()
          Returns if there are more elements to iterate.
 Iterator<String> iterator()
          Returns an Iterator for the elements in this object.
 String next()
          Returns the next object in the iteration.
 void remove()
          Removes the last object returned by next from the collection.
 void setString(String string)
          Sets the string to split
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextUtils.SimpleStringSplitter

public TextUtils.SimpleStringSplitter(char delimiter)
Initializes the splitter. setString may be called later.

Parameters:
delimiter - the delimeter on which to split
Method Detail

setString

public void setString(String string)
Sets the string to split

Specified by:
setString in interface TextUtils.StringSplitter
Parameters:
string - the string to split

iterator

public Iterator<String> iterator()
Description copied from interface: Iterable

Returns an Iterator for the elements in this object.

Specified by:
iterator in interface Iterable<String>
Returns:
An Iterator instance.

hasNext

public boolean hasNext()
Description copied from interface: Iterator
Returns if there are more elements to iterate.

Specified by:
hasNext in interface Iterator<String>
Returns:
true if there are more elements, false otherwise
See Also:
Iterator.next()

next

public String next()
Description copied from interface: Iterator
Returns the next object in the iteration.

Specified by:
next in interface Iterator<String>
Returns:
the next object
See Also:
Iterator.hasNext()

remove

public void remove()
Description copied from interface: Iterator
Removes the last object returned by next from the collection.

Specified by:
remove in interface Iterator<String>

Build 1.0_r1(from source)

Please submit a feedback, bug or feature