ft
Class FTIterator

java.lang.Object
  |
  +--ft.FTIterator
All Implemented Interfaces:
java.util.Iterator

public class FTIterator
extends java.lang.Object
implements java.util.Iterator

An iterator over a FTDictionary. Used to iterate within FTDictionary. There is no need to create this yourself. Use the FTDictionary.iterator instead.

See Also:
FTDictionary, FTDictionary.iterator()

Constructor Summary
FTIterator(FTDictionary parentDictionary)
           
 
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void nextLevel(int key)
          Go to next level in dictionary.
 void prevLevel()
          Go to previous level in dictionary.
 void remove()
          Unsupported method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTIterator

public FTIterator(FTDictionary parentDictionary)
Parameters:
parentDictionary - Iterator is used to iterate within this parentDictionary.
See Also:
FTDictionary.iterator()
Method Detail

nextLevel

public void nextLevel(int key)
Go to next level in dictionary. This means that user adds a key to word that is searched. Iteration continues from start of next level.

Parameters:
key - a button pressed from UI.

prevLevel

public void prevLevel()
Go to previous level in dictionary. Iteration continues from start of previous level.


hasNext

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.)

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator
Returns:
next element in the iteration.
Throws:
java.util.NoSuchElementException - iteration has no more elements.

remove

public void remove()
Unsupported method.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - exception is thrown always, because this method is unsupported.


Markku Korsumäki 2003 code::web