FileDocCategorySizeDatePackage
FilterEnumeration.javaAPI DocExample1348Tue Dec 08 01:21:00 GMT 1998oisoft.togetherx.scripts.SQL.impl

FilterEnumeration

public class FilterEnumeration extends Object implements Enumeration

Fields Summary
private Object
myCurrent
private COM.objectspace.jgl.UnaryFunction
myFilter
private Enumeration
mySource
Constructors Summary
public FilterEnumeration(Enumeration source, COM.objectspace.jgl.UnaryFunction filter)

    mySource = source;
    myFilter = filter;
    myCurrent = null;
    while( mySource.hasMoreElements()
      && myCurrent == null )
    {
      myCurrent = myFilter.execute(mySource.nextElement());
    }
  
Methods Summary
public booleanhasMoreElements()
Tests if this enumeration contains more elements.

return
true if this enumeration contains more elements; false otherwise.
since
JDK1.0

    return myCurrent != null;
  
public java.lang.ObjectnextElement()
Returns the next element of this enumeration.

return
the next element of this enumeration.
exception
NoSuchElementException if no more elements exist.
since
JDK1.0

    Object result = myCurrent;
    myCurrent = null;
    while( mySource.hasMoreElements()
      && myCurrent == null )
    {
      myCurrent = myFilter.execute(mySource.nextElement());
    }
    return result;