Class JNetAsyncEnumerator<TObject>
An extension of https://www.jcobridge.com/api-clr/html/T_MASES_JCOBridge_C2JBridge_JVMBridgeBaseEnumerator_1.htm implementing IAsyncEnumerator<T> used to manage Java Iterator in async way
public class JNetAsyncEnumerator<TObject> : JVMBridgeBasePrefetchableEnumerator<TObject>, IEnumerator<TObject>, IDisposable, IEnumerator, IAsyncEnumerator<TObject>, IAsyncDisposable
Type Parameters
TObject
The returning type of the iterator
- Inheritance
-
JVMBridgeBasePrefetchableEnumeratorJVMBridgeBasePrefetchableEnumerator<TObject>JNetAsyncEnumerator<TObject>
- Implements
-
IEnumerator<TObject>IAsyncEnumerator<TObject>
- Inherited Members
-
JVMBridgeBasePrefetchableEnumerator.Dispose()JVMBridgeBasePrefetchableEnumerator.MoveNext()JVMBridgeBasePrefetchableEnumerator.Reset()
Constructors
JNetAsyncEnumerator(IJavaObject, IEnumerableExtension, CancellationToken)
Initialize a new JNetAsyncEnumerator<TObject>
public JNetAsyncEnumerator(IJavaObject refObj, IEnumerableExtension extension, CancellationToken cancellationToken)
Parameters
refObj
IJavaObjectReference to MASES.JCOBridge.C2JBridge.JVMInterop.IJavaObject implementing Java Iterator
extension
IEnumerableExtensionExtension from MASES.JCOBridge.C2JBridge.JVMBridgeBaseEnumerable<TClass>
cancellationToken
CancellationTokenCancellationToken to use in the iteration
Methods
DoWorkCycle()
protected override bool DoWorkCycle()
Returns
MoveNextAsync()
Advances the enumerator asynchronously to the next element of the collection.
public ValueTask<bool> MoveNextAsync()
Returns
- ValueTask<bool>
A ValueTask<TResult> that will complete with a result of
true
if the enumerator was successfully advanced to the next element, orfalse
if the enumerator has passed the end of the collection.