public final class JCObjectIterator extends JCHandler implements Iterator
IEnumerable object.
Wraps a CLR enumerator obtained from a JCObject that represents a
CLR collection or any type implementing IEnumerable. Each call to
next() crosses the JNI boundary to advance the CLR enumerator and
retrieve the next element, returned as a JCObject.
Instances are created internally by JCObject.iterator() and should
not be constructed directly.
See also: JCOReflector for usage examples.
| Modifier and Type | Method and Description |
|---|---|
int |
hashCode()
Returns the hash code of the underlying CLR enumerator by delegating to the
CLR
GetHashCode method. |
boolean |
hasNext()
Returns
true if the CLR enumerator has more elements. |
Object |
next()
Returns the next element in the CLR enumeration as a
JCObject. |
String |
toString()
Returns the string representation of the underlying CLR enumerator by
delegating to the CLR
ToString method. |
getReferenceforEachRemaining, removepublic int hashCode()
GetHashCode method.public String toString()
ToString method.public boolean hasNext()
true if the CLR enumerator has more elements.
Equivalent to calling MoveNext() on the CLR IEnumerator.
Returns false if the native call fails.public Object next()
JCObject.
Equivalent to reading Current from the CLR IEnumerator
after a successful MoveNext().next in interface IteratorJCObject.NoSuchElementException - if the enumeration has no more elements or
if the native call fails.