net.sourceforge.wohenchan.convert
Class ConverterCursor

java.lang.Object
  |
  +--net.sourceforge.wohenchan.convert.ConverterCursor
All Implemented Interfaces:
ConverterListener, java.util.Enumeration

public class ConverterCursor
extends java.lang.Object
implements ConverterListener, java.util.Enumeration

Convenience class which helps convert asynchronous handling of results to synchronous handling.

Version:
$Name: $ $Date: 2003/06/22 07:46:39 $
Author:
$Author: wtanaka $

Field Summary
private  boolean m_done
           
private  java.util.Vector m_queue
          Queue of Entry_FOUND results.
 
Constructor Summary
ConverterCursor()
           
 
Method Summary
 ConverterEntryInterface[] getRemainder()
           
 void handleConverterEvent(ConverterEvent evt)
           
 boolean hasMoreElements()
          Are there any more search hits?
 java.lang.Object nextElement()
          Gets the next found entry.
 java.lang.String toString()
           
private  void waitUntilWeKnowSomething()
          waits until either we know for sure that there are no elements left, or until another search result comes in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_queue

private java.util.Vector m_queue
Queue of Entry_FOUND results.


m_done

private volatile boolean m_done
Constructor Detail

ConverterCursor

public ConverterCursor()
Method Detail

handleConverterEvent

public void handleConverterEvent(ConverterEvent evt)
Specified by:
handleConverterEvent in interface ConverterListener

waitUntilWeKnowSomething

private void waitUntilWeKnowSomething()
waits until either we know for sure that there are no elements left, or until another search result comes in.


hasMoreElements

public boolean hasMoreElements()
Are there any more search hits?

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if there are more search hits, false if not.

nextElement

public java.lang.Object nextElement()
Gets the next found entry.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next ConverterEvent corresponding to "found entry"

getRemainder

public ConverterEntryInterface[] getRemainder()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object