public synchronized boolean hasMoreElementsR ( ) throws RemoteException , EnumeratorException { if ( elements != null && index < elements . length ) { return true ; } else if ( ! exhausted ) { // Reset our local cache and attempt to fetch the next batch // from the server try { elements = null ; index = 0 ; elements = fetchElements ( PREFETCH_COUNT ) ; return true ; } catch ( NoMoreElementsException ex ) { // We've exhausted the remote result set // FFDCFilter.processException(ex, CLASS_NAME + ".hasMoreElementsR", // "172", this); return false ; } } // Exhausted! return false ; }
Find out if there are any more elements available ; this method will perform prefetching from the remote result set .