code: public synchronized boolean hasNext()
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "hasNext");
  
      if(next == null)
      {
        synchronized(index)
        {
          next = (Index.Entry) cursor.next();
          if(filter != null)
          {
            while(next != null && !filter.matches(next.type))
            {
              next = (Index.Entry) cursor.next();
            }
          }
        }
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "hasNext", new Boolean(next != null));
  
      return (next != null);
    }
docs: /* (non-Javadoc)
  @see java.util.Iterator#hasNext()