IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IterableExtensions.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using System.Linq;
4
5using java.util;
6
7namespace java.lang
8{
9
13 public static class IterableExtensions
14 {
15
22 public static IEnumerable<T> AsEnumerable<T>(this Iterable iterable) => iterable switch
23 {
24 IEnumerable<T> i => i,
25 IEnumerable i => i.Cast<T>(),
26 Collection i => i.AsCollection<T>(),
27 Iterable i => new IterableWrapper<T>(i),
28 };
29
30 }
31
32}
Provides extension methods for working against Java Iterable instances.
static IEnumerable< T > AsEnumerable< T >(this Iterable iterable)
Returns the appropriate wrapper type for the given Iterable.
Wraps an Iterable as a IEnumerable.