TextUtils.SimpleStringSplitter - JRE Emulation | JRE Emulation
public static class

TextUtils.SimpleStringSplitter

extends Object
implements TextUtils.StringSplitter Iterator<String>
java.lang.Object
   ↳ android.text.TextUtils.SimpleStringSplitter

Class Overview

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", "".

Summary

Public Constructors
TextUtils.SimpleStringSplitter(char delimiter)
Initializes the splitter.
Public Methods
boolean hasNext()
Returns true if the iteration has more elements.
Iterator<String> iterator()
Returns an Iterator for the elements in this object.
String next()
Returns the next element in the iteration.
void remove()
Removes from the underlying collection the last element returned by this iterator (optional operation).
void setString(String string)
Sets the string to split
Inherited Methods
[Expand]
From class java.lang.Object
From interface android.text.TextUtils.StringSplitter
From interface java.util.Iterator
From interface java.lang.Iterable

Public Constructors

public TextUtils.SimpleStringSplitter (char delimiter)

Initializes the splitter. setString may be called later.

Parameters
delimiter the delimeter on which to split

Public Methods

public boolean hasNext ()

Returns true if the iteration has more elements. (In other words, returns true if next() would return an element rather than throwing an exception.)

Returns
  • true if the iteration has more elements

public Iterator<String> iterator ()

Returns an Iterator for the elements in this object.

Returns
  • An Iterator instance.

public String next ()

Returns the next element in the iteration.

Returns
  • the next element in the iteration

public void remove ()

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next(). The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.

public void setString (String string)

Sets the string to split

Parameters
string the string to split