org.jinterop.dcom.impls.automation
Interface IJIEnumVariant


public interface IJIEnumVariant

Represents the Windows COM IEnumVARIANT Interface.

Sample Usage:-
//From MSEnumVariant example
JIVariant variant = dispatch.get("_NewEnum");
IJIComObject object2 = variant.getObjectAsComObject();
IJIEnumVariant enumVARIANT = (IJIEnumVariant)JIObjectFactory.narrowObject(object2.queryInterface(IJIEnumVariant.IID));
for (i = 0; i < 10; i++)
{
Object[] values = enumVARIANT.next(1);
JIArray array = (JIArray)values[0];
Object[] arrayObj = (Object[])array.getArrayInstance();
for (int j = 0; j < arrayObj.length; j++)
{
System.out.println(((JIVariant)arrayObj[j]).getObjectAsInt() + "," + ((Integer)values[1]).intValue());
}
}

Since:
1.0

Field Summary
static java.lang.String IID
          IID representing the COM IEnumVARIANT.
 
Method Summary
 IJIEnumVariant Clone()
          Definition from MSDN: Creates a copy of the current state of enumeration.
 java.lang.Object[] next(int celt)
          Definition from MSDN: Attempts to get the next celt items in the enumeration sequence.
 void reset()
          Definition from MSDN: Resets the enumeration sequence to the beginning.
 void skip(int celt)
          Definition from MSDN: Attempts to skip over the next celt elements in the enumeration sequence.
 

Field Detail

IID

static final java.lang.String IID
IID representing the COM IEnumVARIANT.

See Also:
Constant Field Values
Method Detail

next

java.lang.Object[] next(int celt)
                        throws JIException
Definition from MSDN: Attempts to get the next celt items in the enumeration sequence. If fewer than the requested number of elements remain in the sequence, Next returns only the remaining elements.

Parameters:
celt - number of elements to be returned.
Returns:
results
Throws:
JIException

skip

void skip(int celt)
          throws JIException
Definition from MSDN: Attempts to skip over the next celt elements in the enumeration sequence.

Parameters:
celt - number of elements to skip.
Throws:
JIException

reset

void reset()
           throws JIException
Definition from MSDN: Resets the enumeration sequence to the beginning. There is no guarantee that exactly the same set of variants will be enumerated the second time as was enumerated the first time. Although an exact duplicate is desirable, the outcome depends on the collection being enumerated. You may find that it is impractical for some collections to maintain this condition (for example, an enumeration of the files in a directory).

Throws:
JIException

Clone

IJIEnumVariant Clone()
                     throws JIException
Definition from MSDN: Creates a copy of the current state of enumeration. Using this function, a particular point in the enumeration sequence can be recorded, and then returned to at a later time. The returned enumerator is of the same actual interface as the one that is being cloned.

There is no guarantee that exactly the same set of variants will be enumerated the second time as was enumerated the first. Although an exact duplicate is desirable, the outcome depends on the collection being enumerated. You may find that it is impractical for some collections to maintain this condition (for example, an enumeration of the files in a directory).

Returns:
reference to the clone.
Throws:
JIException