Uses of Interface java.util.Iterator (Java SE 25 & JDK 25)
Description: use: module: java.base, package: java.util, interface: Iterator

# Uses of Interface
java.util.Iterator

Packages that use Iterator
Package
Description
com.sun.jdi.event
This package defines JDI events and event processing.
com.sun.source.util
Provides utilities for operations on abstract syntax trees (AST).
java.applet
Provides the classes necessary to create an applet and the classes an applet uses to communicate with its applet context.
java.awt.dnd
Drag and Drop is a direct manipulation gesture found in many Graphical User Interface systems that provides a mechanism to transfer information between two entities logically associated with presentation elements in the GUI.
java.beans.beancontext
Provides classes and interfaces relating to bean context.
java.lang
Provides classes that are fundamental to the design of the Java programming language.
java.lang.classfile
Provides classfile parsing, generation, and transformation library.
java.lang.classfile.constantpool
Provides interfaces describing constant pool entries for the `java.lang.classfile` library.
java.nio.charset.spi
Service-provider classes for the `java.nio.charset` package.
java.nio.file
Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.
java.security.cert
Provides classes and interfaces for parsing and managing certificates, certificate revocation lists (CRLs), and certification paths.
java.sql
Provides the API for accessing and processing data stored in a data source (usually a relational database) using the Java programming language.
java.util
Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.
java.util.concurrent
Utility classes commonly useful in concurrent programming.
java.util.stream
Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.
javax.imageio
The main package of the Java Image I/O API.
javax.imageio.spi
A package of the Java Image I/O API containing the plug-in interfaces for readers, writers, transcoders, and streams, and a runtime registry.
javax.tools
Provides interfaces for tools which can be invoked from a program, for example, compilers.
javax.xml.crypto
Common classes for XML cryptography.
javax.xml.crypto.dom
DOM-specific classes for the `javax.xml.crypto` package.
javax.xml.namespace
Defines XML Namespace processing.
javax.xml.stream
Defines interfaces and classes for the Streaming API for XML (StAX).
javax.xml.stream.events
Defines event interfaces for the Streaming API for XML (StAX).
javax.xml.stream.util
Provides utility classes for the Streaming API for XML (StAX).
javax.xml.xpath
Provides an object-model neutral API for the evaluation of XPath expressions and access to the evaluation environment.

- ## Uses of Iterator in com.sun.jdi.event

  Subinterfaces of Iterator in com.sun.jdi.event
  Modifier and Type
  Interface
  Description
  `interface`
  `EventIterator`
  EventIterators are unmodifiable.

- ## Uses of Iterator in com.sun.source.util

  Methods in com.sun.source.util that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<DocTree>`
  DocTreePath.`iterator()`
  `Iterator<Tree>`
  TreePath.`iterator()`
  Iterates from leaves to root.

- ## Uses of Iterator in java.applet

  Methods in java.applet that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<String>`
  AppletContext.`getStreamKeys()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Finds all the keys of the streams in this applet context.

- ## Uses of Iterator in java.awt.dnd

  Methods in java.awt.dnd that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<InputEvent>`
  DragGestureEvent.`iterator()`
  Returns an `Iterator` for the events comprising the gesture.

- ## Uses of Iterator in java.beans.beancontext

  Classes in java.beans.beancontext that implement Iterator
  Modifier and Type
  Class
  Description
  `protected static final class`
  `BeanContextSupport.BCSIterator`
  Deprecated, for removal: This API element is subject to removal in a future version.
  protected final subclass that encapsulates an iterator but implements a noop remove() method.
  Methods in java.beans.beancontext that return Iterator
  Modifier and Type
  Method
  Description
  `protected Iterator<BeanContextSupport.BCSChild>`
  BeanContextSupport.`bcsChildren()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Returns an iterator of all children of this `BeanContext`.
  `Iterator<?>`
  BeanContextServices.`getCurrentServiceClasses()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Gets the currently available services for this context.
  `Iterator<Object>`
  BeanContextServicesSupport.`getCurrentServiceClasses()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `Iterator<?>`
  BeanContextServiceAvailableEvent.`getCurrentServiceSelectors()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Gets the list of service dependent selectors.
  `Iterator<?>`
  BeanContextServiceProvider.`getCurrentServiceSelectors(BeanContextServices bcs, Class<?> serviceClass)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Invoked by `BeanContextServices`, this method gets the current service selectors for the specified service.
  `Iterator<?>`
  BeanContextServices.`getCurrentServiceSelectors(Class<?> serviceClass)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.
  `Iterator<?>`
  BeanContextServicesSupport.BCSSProxyServiceProvider.`getCurrentServiceSelectors(BeanContextServices bcs, Class<?> serviceClass)`
  `Iterator<?>`
  BeanContextServicesSupport.`getCurrentServiceSelectors(Class<?> serviceClass)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `Iterator`
  BeanContextMembershipEvent.`iterator()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Gets the array of children affected by this event.
  `Iterator<Object>`
  BeanContextSupport.`iterator()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Gets all JavaBean or `BeanContext` instances currently nested in this `BeanContext`.

- ## Uses of Iterator in java.lang

  Methods in java.lang that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<T>`
  Iterable.`iterator()`
  Returns an iterator over elements of type `T`.

- ## Uses of Iterator in java.lang.classfile

  Methods in java.lang.classfile that return Iterator
  Modifier and Type
  Method
  Description
  `default Iterator<E>`
  CompoundElement.`iterator()`
  Returns an `Iterator` describing all member elements in this compound element.

- ## Uses of Iterator in java.lang.classfile.constantpool

  Methods in java.lang.classfile.constantpool that return Iterator
  Modifier and Type
  Method
  Description
  `default Iterator<PoolEntry>`
  ConstantPool.`iterator()`
  Returns an iterator over pool entries.

- ## Uses of Iterator in java.nio.charset.spi

  Methods in java.nio.charset.spi that return Iterator
  Modifier and Type
  Method
  Description
  `abstract Iterator<Charset>`
  CharsetProvider.`charsets()`
  Creates an iterator that iterates over the charsets supported by this provider.

- ## Uses of Iterator in java.nio.file

  Methods in java.nio.file that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<T>`
  DirectoryStream.`iterator()`
  Returns the iterator associated with this `DirectoryStream`.
  `default Iterator<Path>`
  Path.`iterator()`
  Returns an iterator over the name elements of this path.

- ## Uses of Iterator in java.security.cert

  Methods in java.security.cert that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<String>`
  CertificateFactorySpi.`engineGetCertPathEncodings()`
  Returns an iteration of the `CertPath` encodings supported by this certificate factory, with the default encoding first.
  `final Iterator<String>`
  CertificateFactory.`getCertPathEncodings()`
  Returns an iteration of the `CertPath` encodings supported by this certificate factory, with the default encoding first.
  `Iterator<? extends PolicyNode>`
  PolicyNode.`getChildren()`
  Returns an iterator over the children of this node.
  `abstract Iterator<String>`
  CertPath.`getEncodings()`
  Returns an iteration of the encodings supported by this certification path, with the default encoding first.

- ## Uses of Iterator in java.sql

  Methods in java.sql that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<Throwable>`
  SQLException.`iterator()`
  Returns an iterator over the chained SQLExceptions.

- ## Uses of Iterator in java.util

  Subinterfaces of Iterator in java.util
  Modifier and Type
  Interface
  Description
  `interface`
  `ListIterator<E>`
  An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list.
  `interface`
  `PrimitiveIterator<T,T_CONS>`
  A base type for primitive specializations of `Iterator`.
  `static interface`
  `PrimitiveIterator.OfDouble`
  An Iterator specialized for `double` values.
  `static interface`
  `PrimitiveIterator.OfInt`
  An Iterator specialized for `int` values.
  `static interface`
  `PrimitiveIterator.OfLong`
  An Iterator specialized for `long` values.
  Classes in java.util that implement Iterator
  Modifier and Type
  Class
  Description
  `final class`
  `Scanner`
  A simple text scanner which can parse primitive types and strings using regular expressions.
  Methods in java.util that return Iterator
  Modifier and Type
  Method
  Description
  `default Iterator<E>`
  Enumeration.`asIterator()`
  Returns an `Iterator` that traverses the remaining elements covered by this enumeration.
  `Iterator<E>`
  ArrayDeque.`descendingIterator()`
  `Iterator<E>`
  Deque.`descendingIterator()`
  Returns an iterator over the elements in this deque in reverse sequential order.
  `Iterator<E>`
  LinkedList.`descendingIterator()`
  `Iterator<E>`
  NavigableSet.`descendingIterator()`
  Returns an iterator over the elements in this set, in descending order.
  `Iterator<E>`
  TreeSet.`descendingIterator()`
  Returns an iterator over the elements in this set in descending order.
  `static <T> Iterator<T>`
  Collections.`emptyIterator()`
  Returns an iterator that has no elements.
  `abstract Iterator<E>`
  AbstractCollection.`iterator()`
  Returns an iterator over the elements contained in this collection.
  `Iterator<E>`
  AbstractList.`iterator()`
  Returns an iterator over the elements in this list in proper sequence.
  `Iterator<E>`
  AbstractSequentialList.`iterator()`
  Returns an iterator over the elements in this list (in proper sequence).
  `Iterator<E>`
  ArrayDeque.`iterator()`
  Returns an iterator over the elements in this deque.
  `Iterator<E>`
  ArrayList.`iterator()`
  Returns an iterator over the elements in this list in proper sequence.
  `Iterator<E>`
  Collection.`iterator()`
  Returns an iterator over the elements in this collection.
  `Iterator<E>`
  Deque.`iterator()`
  Returns an iterator over the elements in this deque in proper sequence.
  `Iterator<E>`
  HashSet.`iterator()`
  Returns an iterator over the elements in this set.
  `Iterator<E>`
  List.`iterator()`
  Returns an iterator over the elements in this list in proper sequence.
  `Iterator<E>`
  NavigableSet.`iterator()`
  Returns an iterator over the elements in this set, in ascending order.
  `Iterator<E>`
  PriorityQueue.`iterator()`
  Returns an iterator over the elements in this queue.
  `Iterator<S>`
  ServiceLoader.`iterator()`
  Returns an iterator to lazily load and instantiate the available providers of this loader's service.
  `Iterator<E>`
  Set.`iterator()`
  Returns an iterator over the elements in this set.
  `static <T> Iterator<T>`
  Spliterators.`iterator(Spliterator<? extends T> spliterator)`
  Creates an `Iterator` from a `Spliterator`.
  `Iterator<E>`
  TreeSet.`iterator()`
  Returns an iterator over the elements in this set in ascending order.
  `Iterator<E>`
  Vector.`iterator()`
  Returns an iterator over the elements in this list in proper sequence.
  Methods in java.util with parameters of type Iterator
  Modifier and Type
  Method
  Description
  `static <T> Spliterator<T>`
  Spliterators.`spliterator(Iterator<? extends T> iterator, long size, int characteristics)`
  Creates a `Spliterator` using a given `Iterator` as the source of elements, and with a given initially reported size.
  `static <T> Spliterator<T>`
  Spliterators.`spliteratorUnknownSize(Iterator<? extends T> iterator, int characteristics)`
  Creates a `Spliterator` using a given `Iterator` as the source of elements, with no initial size estimate.

- ## Uses of Iterator in java.util.concurrent

  Methods in java.util.concurrent that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<E>`
  ConcurrentLinkedDeque.`descendingIterator()`
  Returns an iterator over the elements in this deque in reverse sequential order.
  `Iterator<E>`
  ConcurrentSkipListSet.`descendingIterator()`
  Returns an iterator over the elements in this set in descending order.
  `Iterator<E>`
  LinkedBlockingDeque.`descendingIterator()`
  Returns an iterator over the elements in this deque in reverse sequential order.
  `Iterator<E>`
  ArrayBlockingQueue.`iterator()`
  Returns an iterator over the elements in this queue in proper sequence.
  `Iterator<E>`
  BlockingDeque.`iterator()`
  Returns an iterator over the elements in this deque in proper sequence.
  `Iterator<K>`
  ConcurrentHashMap.KeySetView.`iterator()`
  `Iterator<E>`
  ConcurrentLinkedDeque.`iterator()`
  Returns an iterator over the elements in this deque in proper sequence.
  `Iterator<E>`
  ConcurrentLinkedQueue.`iterator()`
  Returns an iterator over the elements in this queue in proper sequence.
  `Iterator<E>`
  ConcurrentSkipListSet.`iterator()`
  Returns an iterator over the elements in this set in ascending order.
  `Iterator<E>`
  CopyOnWriteArrayList.`iterator()`
  Returns an iterator over the elements in this list in proper sequence.
  `Iterator<E>`
  CopyOnWriteArraySet.`iterator()`
  Returns an iterator over the elements contained in this set in the order in which these elements were added.
  `Iterator<E>`
  DelayQueue.`iterator()`
  Returns an iterator over all the elements (both expired and unexpired) in this queue.
  `Iterator<E>`
  LinkedBlockingDeque.`iterator()`
  Returns an iterator over the elements in this deque in proper sequence.
  `Iterator<E>`
  LinkedBlockingQueue.`iterator()`
  Returns an iterator over the elements in this queue in proper sequence.
  `Iterator<E>`
  LinkedTransferQueue.`iterator()`
  Returns an iterator over the elements in this queue in proper sequence.
  `Iterator<E>`
  PriorityBlockingQueue.`iterator()`
  Returns an iterator over the elements in this queue.
  `Iterator<E>`
  SynchronousQueue.`iterator()`
  Returns an empty iterator in which `hasNext` always returns `false`.

- ## Uses of Iterator in java.util.stream

  Methods in java.util.stream that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<T>`
  BaseStream.`iterator()`
  Returns an iterator for the elements of this stream.

- ## Uses of Iterator in javax.imageio

  Methods in javax.imageio that return Iterator
  Modifier and Type
  Method
  Description
  `static Iterator<ImageReader>`
  ImageIO.`getImageReaders(Object input)`
  Returns an `Iterator` containing all currently registered `ImageReader`s that claim to be able to decode the supplied `Object`, typically an `ImageInputStream`.
  `static Iterator<ImageReader>`
  ImageIO.`getImageReadersByFormatName(String formatName)`
  Returns an `Iterator` containing all currently registered `ImageReader`s that claim to be able to decode the named format.
  `static Iterator<ImageReader>`
  ImageIO.`getImageReadersByMIMEType(String MIMEType)`
  Returns an `Iterator` containing all currently registered `ImageReader`s that claim to be able to decode files with the given MIME type.
  `static Iterator<ImageReader>`
  ImageIO.`getImageReadersBySuffix(String fileSuffix)`
  Returns an `Iterator` containing all currently registered `ImageReader`s that claim to be able to decode files with the given suffix.
  `static Iterator<ImageTranscoder>`
  ImageIO.`getImageTranscoders(ImageReader reader, ImageWriter writer)`
  Returns an `Iterator` containing all currently registered `ImageTranscoder`s that claim to be able to transcode between the metadata of the given `ImageReader` and `ImageWriter`.
  `abstract Iterator<ImageTypeSpecifier>`
  ImageReader.`getImageTypes(int imageIndex)`
  Returns an `Iterator` containing possible image types to which the given image may be decoded, in the form of `ImageTypeSpecifiers`s.
  `static Iterator<ImageWriter>`
  ImageIO.`getImageWriters(ImageTypeSpecifier type, String formatName)`
  Returns an `Iterator` containing all currently registered `ImageWriter`s that claim to be able to encode images of the given layout (specified using an `ImageTypeSpecifier`) in the given format.
  `static Iterator<ImageWriter>`
  ImageIO.`getImageWritersByFormatName(String formatName)`
  Returns an `Iterator` containing all currently registered `ImageWriter`s that claim to be able to encode the named format.
  `static Iterator<ImageWriter>`
  ImageIO.`getImageWritersByMIMEType(String MIMEType)`
  Returns an `Iterator` containing all currently registered `ImageWriter`s that claim to be able to encode files with the given MIME type.
  `static Iterator<ImageWriter>`
  ImageIO.`getImageWritersBySuffix(String fileSuffix)`
  Returns an `Iterator` containing all currently registered `ImageWriter`s that claim to be able to encode files with the given suffix.
  `Iterator<IIOImage>`
  ImageReader.`readAll(Iterator<? extends ImageReadParam> params)`
  Returns an `Iterator` containing all the images, thumbnails, and metadata, starting at the index given by `getMinIndex`, from the input source in the form of `IIOImage` objects.
  Methods in javax.imageio with parameters of type Iterator
  Modifier and Type
  Method
  Description
  `protected static BufferedImage`
  ImageReader.`getDestination(ImageReadParam param, Iterator<ImageTypeSpecifier> imageTypes, int width, int height)`
  Returns the `BufferedImage` to which decoded pixel data should be written.
  `Iterator<IIOImage>`
  ImageReader.`readAll(Iterator<? extends ImageReadParam> params)`
  Returns an `Iterator` containing all the images, thumbnails, and metadata, starting at the index given by `getMinIndex`, from the input source in the form of `IIOImage` objects.

- ## Uses of Iterator in javax.imageio.spi

  Methods in javax.imageio.spi that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<Class<?>>`
  ServiceRegistry.`getCategories()`
  Returns an `Iterator` of `Class` objects indicating the current set of categories.
  `<T> Iterator<T>`
  ServiceRegistry.`getServiceProviders(Class<T> category, boolean useOrdering)`
  Returns an `Iterator` containing all registered service providers in the given category.
  `<T> Iterator<T>`
  ServiceRegistry.`getServiceProviders(Class<T> category, ServiceRegistry.Filter filter, boolean useOrdering)`
  Returns an `Iterator` containing service provider objects within a given category that satisfy a criterion imposed by the supplied `ServiceRegistry.Filter` object's `filter` method.
  `static <T> Iterator<T>`
  ServiceRegistry.`lookupProviders(Class<T> providerClass)`
  Locates and incrementally instantiates the available providers of a given service using the context class loader.
  `static <T> Iterator<T>`
  ServiceRegistry.`lookupProviders(Class<T> providerClass, ClassLoader loader)`
  Searches for implementations of a particular service class using the given class loader.
  Methods in javax.imageio.spi with parameters of type Iterator
  Modifier and Type
  Method
  Description
  `void`
  ServiceRegistry.`registerServiceProviders(Iterator<?> providers)`
  Adds a set of service provider objects, taken from an `Iterator` to the registry.
  Constructors in javax.imageio.spi with parameters of type Iterator
  Modifier
  Constructor
  Description
  ``
  `ServiceRegistry(Iterator<Class<?>> categories)`
  Constructs a `ServiceRegistry` instance with a set of categories taken from the `categories` argument.

- ## Uses of Iterator in javax.tools

  Methods in javax.tools with parameters of type Iterator
  Modifier and Type
  Method
  Description
  `boolean`
  ForwardingJavaFileManager.`handleOption(String current, Iterator<String> remaining)`
  `boolean`
  JavaFileManager.`handleOption(String current, Iterator<String> remaining)`
  Handles one option.

- ## Uses of Iterator in javax.xml.crypto

  Methods in javax.xml.crypto that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<T>`
  NodeSetData.`iterator()`
  Returns a read-only iterator over the nodes contained in this `NodeSetData` in document order.

- ## Uses of Iterator in javax.xml.crypto.dom

  Methods in javax.xml.crypto.dom that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<Map.Entry<String,Element>>`
  DOMCryptoContext.`iterator()`
  Returns a read-only iterator over the set of Id/Element mappings of this `DOMCryptoContext`.

- ## Uses of Iterator in javax.xml.namespace

  Methods in javax.xml.namespace that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<String>`
  NamespaceContext.`getPrefixes(String namespaceURI)`
  Get all prefixes bound to a Namespace URI in the current scope.

- ## Uses of Iterator in javax.xml.stream

  Subinterfaces of Iterator in javax.xml.stream
  Modifier and Type
  Interface
  Description
  `interface`
  `XMLEventReader`
  This is the top level interface for parsing XML Events.
  Methods in javax.xml.stream with parameters of type Iterator
  Modifier and Type
  Method
  Description
  `abstract EndElement`
  XMLEventFactory.`createEndElement(String prefix, String namespaceUri, String localName, Iterator<? extends Namespace> namespaces)`
  Create a new EndElement
  `abstract EndElement`
  XMLEventFactory.`createEndElement(QName name, Iterator<? extends Namespace> namespaces)`
  Create a new EndElement
  `abstract StartElement`
  XMLEventFactory.`createStartElement(String prefix, String namespaceUri, String localName, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces)`
  Create a new StartElement.
  `abstract StartElement`
  XMLEventFactory.`createStartElement(String prefix, String namespaceUri, String localName, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces, NamespaceContext context)`
  Create a new StartElement.
  `abstract StartElement`
  XMLEventFactory.`createStartElement(QName name, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces)`
  Create a new StartElement.

- ## Uses of Iterator in javax.xml.stream.events

  Methods in javax.xml.stream.events that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<Attribute>`
  StartElement.`getAttributes()`
  Returns an Iterator of non-namespace attributes declared on this START_ELEMENT.
  `Iterator<Namespace>`
  EndElement.`getNamespaces()`
  Returns an Iterator of namespaces that have gone out of scope.
  `Iterator<Namespace>`
  StartElement.`getNamespaces()`
  Returns an Iterator of namespaces declared on this element.

- ## Uses of Iterator in javax.xml.stream.util

  Classes in javax.xml.stream.util that implement Iterator
  Modifier and Type
  Class
  Description
  `class`
  `EventReaderDelegate`
  This is the base class for deriving an XMLEventReader filter.

- ## Uses of Iterator in javax.xml.xpath

  Methods in javax.xml.xpath that return Iterator
  Modifier and Type
  Method
  Description
  `Iterator<Node>`
  XPathNodes.`iterator()`
  Returns an iterator of the Nodes.