mySource = source; myFilter = filter; myCurrent = null; while( mySource.hasMoreElements() && myCurrent == null ) { myCurrent = myFilter.execute(mySource.nextElement()); }
Tests if this enumeration contains more elements.returntrue if this enumeration contains more elements; false otherwise.sinceJDK1.0 return myCurrent != null;
true
false
return myCurrent != null;
Returns the next element of this enumeration.returnthe next element of this enumeration.exceptionNoSuchElementException if no more elements exist.sinceJDK1.0 Object result = myCurrent; myCurrent = null; while( mySource.hasMoreElements() && myCurrent == null ) { myCurrent = myFilter.execute(mySource.nextElement()); } return result;
Object result = myCurrent; myCurrent = null; while( mySource.hasMoreElements() && myCurrent == null ) { myCurrent = myFilter.execute(mySource.nextElement()); } return result;