Package com.sun.jna.platform.win32.COM
Class IComEnumVariantIterator
java.lang.Object
com.sun.jna.platform.win32.COM.IComEnumVariantIterator
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Iterable<Variant.VARIANT>,- Iterator<Variant.VARIANT>
public class IComEnumVariantIterator
extends Object
implements Iterable<Variant.VARIANT>, Iterator<Variant.VARIANT>, Closeable
Wrapper for an EnumVariant Iteration. The usecase is a for-loop in the style:
 
 // Aquire an IDispatch, that has a new NewEnum Property (DISPID_NEWENUM)
 for(VARIANT v: IComEnumVariantIterator.wrap(dispatch)) {
      // Work with the acquired Variant
      // ...
      // Finally free it
      OleAuto.INSTANCE.VariantClear(v);
 }
 The IComEnumVariantIterator iterator closes the enumeration it
 wraps after the enumeration is exhausted or when the iterator is GCed,
 whatever happens earlier.
- 
Constructor SummaryConstructorsConstructorDescriptionIComEnumVariantIterator(EnumVariant backingIteration) IComEnumVariantIterator wraps the supplied EnumVariant and exposes that as anIterable<Variant.VARIANT>/Iterator<Variant.VARIANT>.
- 
Method SummaryMethods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface java.util.IteratorforEachRemaining
- 
Constructor Details- 
IComEnumVariantIteratorIComEnumVariantIterator wraps the supplied EnumVariant and exposes that as anIterable<Variant.VARIANT>/Iterator<Variant.VARIANT>. The class takes possion of the supplied EnumVariant. So the EnumVariant is Released when the enumeration is exhausted or the Iterator is GCed.- Parameters:
- backingIteration-
 
 
- 
- 
Method Details- 
wrapHelper to get new enumeration from anIDispatch.This expects, that the supplied IDispatch has a property identified by a OaIdl.DISPIDofOaIdl.DISPID_NEWENUM- Parameters:
- dispatch- IDispatch to be analysed
- Returns:
- IComEnumVariantIterator wrapping the enumeration queried from the supplied object
 
- 
hasNextpublic boolean hasNext()- Specified by:
- hasNextin interface- Iterator<Variant.VARIANT>
 
- 
next- Specified by:
- nextin interface- Iterator<Variant.VARIANT>
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
- 
finalize
- 
iterator- Specified by:
- iteratorin interface- Iterable<Variant.VARIANT>
 
- 
removepublic void remove()- Specified by:
- removein interface- Iterator<Variant.VARIANT>
 
 
-