IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IterableWrapper.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Collections.Generic;
4
5using java.util;
6
7namespace java.lang
8{
9
13 class IterableWrapper<T> : IEnumerable<T>
14 {
15
16 readonly Iterable _iterable;
17
23 public IterableWrapper(Iterable iterable)
24 {
25 _iterable = iterable ?? throw new ArgumentNullException(nameof(iterable));
26 }
27
32 public IEnumerator<T> GetEnumerator()
33 {
34 return new IteratorWrapper<T>(_iterable.iterator());
35 }
36
37 IEnumerator IEnumerable.GetEnumerator()
38 {
39 return GetEnumerator();
40 }
41
42 }
43
44}
Wraps an Iterable as a IEnumerable.
IEnumerator< T > GetEnumerator()
Returns an enumerator that wraps the given iterable.
IterableWrapper(Iterable iterable)
Initializes a new instance.