com.ibm.icu.util
Class CharsTrie.Iterator

java.lang.Object
  extended by com.ibm.icu.util.CharsTrie.Iterator
All Implemented Interfaces:
Iterator<CharsTrie.Entry>
Enclosing class:
CharsTrie

public static final class CharsTrie.Iterator
extends Object
implements Iterator<CharsTrie.Entry>

Iterator for all of the (string, value) pairs in a CharsTrie.

Status:
Stable ICU 4.8.

Method Summary
 boolean hasNext()
           
 CharsTrie.Entry next()
          Finds the next (string, value) pair if there is one.
 void remove()
          Iterator.remove() is not supported.
 CharsTrie.Iterator reset()
          Resets this iterator to its initial state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

reset

public CharsTrie.Iterator reset()
Resets this iterator to its initial state.

Returns:
this
Status:
Stable ICU 4.8.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<CharsTrie.Entry>
Returns:
true if there are more elements.
Status:
Stable ICU 4.8.

next

public CharsTrie.Entry next()
Finds the next (string, value) pair if there is one. If the string is truncated to the maximum length and does not have a real value, then the value is set to -1. In this case, this "not a real value" is indistinguishable from a real value of -1.

Specified by:
next in interface Iterator<CharsTrie.Entry>
Returns:
An Entry with the string and value of the next element.
Throws:
NoSuchElementException - - iteration has no more elements.
Status:
Stable ICU 4.8.

remove

public void remove()
Iterator.remove() is not supported.

Specified by:
remove in interface Iterator<CharsTrie.Entry>
Throws:
UnsupportedOperationException - (always)
Status:
Stable ICU 4.8.


Copyright (c) 2012 IBM Corporation and others.