Package com.sun.jna.platform.win32.COM
Class IComEnumVariantIterator
- java.lang.Object
- 
- com.sun.jna.platform.win32.COM.IComEnumVariantIterator
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable,- java.lang.Iterable<Variant.VARIANT>,- java.util.Iterator<Variant.VARIANT>
 
 public class IComEnumVariantIterator extends java.lang.Object implements java.lang.Iterable<Variant.VARIANT>, java.util.Iterator<Variant.VARIANT>, java.io.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 IComEnumVariantIteratoriterator closes the enumeration it wraps after the enumeration is exhausted or when the iterator is GCed, whatever happens earlier.
- 
- 
Constructor SummaryConstructors Constructor Description IComEnumVariantIterator(EnumVariant backingIteration)IComEnumVariantIterator wraps the supplied EnumVariant and exposes that as anIterable<Variant.VARIANT>/Iterator<Variant.VARIANT>.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidfinalize()booleanhasNext()java.util.Iterator<Variant.VARIANT>iterator()Variant.VARIANTnext()voidremove()static IComEnumVariantIteratorwrap(IDispatch dispatch)Helper to get new enumeration from anIDispatch.
 
- 
- 
- 
Constructor Detail- 
IComEnumVariantIteratorpublic IComEnumVariantIterator(EnumVariant backingIteration) IComEnumVariantIterator 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 Detail- 
wrappublic static IComEnumVariantIterator wrap(IDispatch dispatch) Helper 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- java.util.Iterator<Variant.VARIANT>
 
 - 
nextpublic Variant.VARIANT next() - Specified by:
- nextin interface- java.util.Iterator<Variant.VARIANT>
 
 - 
closepublic void close() - Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- java.lang.Object
- Throws:
- java.lang.Throwable
 
 - 
iteratorpublic java.util.Iterator<Variant.VARIANT> iterator() - Specified by:
- iteratorin interface- java.lang.Iterable<Variant.VARIANT>
 
 - 
removepublic void remove() - Specified by:
- removein interface- java.util.Iterator<Variant.VARIANT>
 
 
- 
 
-