org.openide.util.enum
Class QueueEnumeration

java.lang.Object
  |
  +--org.openide.util.enum.QueueEnumeration
All Implemented Interfaces:
Enumeration

public class QueueEnumeration
extends Object
implements Enumeration

Enumeration that represents a queue. It allows by redefining method process each outputed object to add other to the end of queue of waiting objects by a call to put.


Constructor Summary
QueueEnumeration()
           
 
Method Summary
 boolean hasMoreElements()
          Is there any next object?
 Object nextElement()
           
protected  void process(Object o)
          Processes object before it is returned from nextElement method.
 void put(Object o)
          Put adds new object to the end of queue.
 void put(Object[] arr)
          Adds array of objects into the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueEnumeration

public QueueEnumeration()
Method Detail

process

protected void process(Object o)
Processes object before it is returned from nextElement method. This method allows to add other object to the end of the queue by a call to put method. This implementation does nothing.
Parameters:
o - the object to be processed
See Also:
put(java.lang.Object)

put

public void put(Object o)
Put adds new object to the end of queue.
Parameters:
o - the object to add

put

public void put(Object[] arr)
Adds array of objects into the queue.
Parameters:
arr - array of objects to put into the queue

hasMoreElements

public boolean hasMoreElements()
Is there any next object?
Specified by:
hasMoreElements in interface Enumeration
Returns:
true if there is next object, false otherwise

nextElement

public Object nextElement()
Specified by:
nextElement in interface Enumeration
Returns:
next object in enumeration
Throws:
NoSuchElementException - if there is no next object


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.