Provides extension methods for working against Java Iterator instances.
More...
|
| static IEnumerator< T > | AsEnumerator< T > (this Iterator iterator) |
| | Returns the appropriate wrapper type for the given Iterator.
|
| |
| static List< T > | RemainingToList< T > (this Iterator iterator) |
| | Iterators over the items in an iterator and produces an array.
|
| |
| static IEnumerable< T > | RemainingToEnumerable< T > (this Iterator iterator) |
| | Returns an enumerable that iterators over the items in an iterator.
|
| |
Provides extension methods for working against Java Iterator instances.
Definition at line 9 of file IteratorExtensions.cs.
◆ AsEnumerator< T >()
| static IEnumerator< T > java.util.IteratorExtensions.AsEnumerator< T > |
( |
this Iterator | iterator | ) |
|
|
static |
Returns the appropriate wrapper type for the given Iterator.
- Template Parameters
-
- Parameters
-
- Returns
◆ RemainingToEnumerable< T >()
| static IEnumerable< T > java.util.IteratorExtensions.RemainingToEnumerable< T > |
( |
this Iterator | iterator | ) |
|
|
static |
Returns an enumerable that iterators over the items in an iterator.
- Template Parameters
-
- Parameters
-
- Returns
Definition at line 45 of file IteratorExtensions.cs.
46 {
47 while (iterator.hasNext())
48 yield return (T)iterator.next();
49 }
◆ RemainingToList< T >()
| static List< T > java.util.IteratorExtensions.RemainingToList< T > |
( |
this Iterator | iterator | ) |
|
|
static |
Iterators over the items in an iterator and produces an array.
- Template Parameters
-
- Parameters
-
- Returns
Definition at line 30 of file IteratorExtensions.cs.
31 {
32 var l = new List<T>();
33 while (iterator.hasNext())
34 l.Add((T)iterator.next());
35
36 return l;
37 }
The documentation for this class was generated from the following file: