LibreOffice LibreOffice 25.8 SDK API Reference

Public Member Functions | List of all members
XEnumeration Interface Referencepublished

provides functionality to enumerate the contents of a container. More...

`import"XEnumeration.idl";`

Inheritance diagram for XEnumeration:

## Public Member Functions
boolean | hasMoreElements ()
| tests whether this enumeration contains more elements. More...
any | nextElement () raises ( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

provides functionality to enumerate the contents of a container.

An object that implements the XEnumeration interface generates a series of elements, one at a time. Successive calls to the `XEnumeration::nextElement` method return successive elements of the series.

For example (Java), to print all elements of a vector aVect:

for (XEnumeration xEnum = aVect.elements() ; xEnum.hasMoreElements() ; )
{
System.out.println( xEnum.nextElement() );
}

If the object changed, the behavior of the enumeration is not specified. This is not a remote interface.

## Member Function Documentation

## ◆ hasMoreElements()

boolean hasMoreElements | ( |  | ) |

tests whether this enumeration contains more elements.

## ◆ nextElement()

any nextElement | ( |  | ) |
raises | ( | com::sun::star::container::NoSuchElementException,
|  | com::sun::star::lang::WrappedTargetException
| ) |  |

Returns
  the next element of this enumeration.

Exceptions

  NoSuchElementException | if no more elements exist.
  com::sun::star::lang::WrappedTargetException | If the implementation has internal reasons for exceptions, then wrap these in a com::sun::star::lang::WrappedTargetException exception.

The documentation for this interface was generated from the following file:

- com/sun/star/container/XEnumeration.idl