/** * Returns {@code true} if the iteration has more elements. * (In other words, returns {@code true} if {@link #next} would * return an element rather than throwing an exception.) * * @return {@code true} if the iteration has more elements */ public boolean hasNext() { return getCurrentIterator()==null? false: getCurrentIterator().hasNext(); }
/** * Get services per type. * @param type The interface type. If type is null all services are returned. * @return First matching service or null. */ public Iterator<IService> getServices(ClassInfo type) { MultiIterator<IService> ret = new MultiIterator<IService>(); // if(type.getTypeName().indexOf("Fact")!=-1) // System.out.println("hhhhhhhhhhhhheere"); if(registries!=null) { for(Map.Entry<IComponentIdentifier, IServiceRegistry> entry: registries.entrySet()) { IServiceRegistry reg = entry.getValue(); Iterator<IService> it = reg.getServices(type); if(it!=null) ret.addIterator(it); } } return ret; }
/** * Returns the next element in the iteration. * * @return the next element in the iteration * @throws NoSuchElementException if the iteration has no more elements */ public T next() { return getCurrentIterator().next(); }