IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
ModuleFinder.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Immutable;
3
5{
6
10 internal abstract class ModuleFinder : IModuleFinder
11 {
12
16 public static IModuleFinder Empty => EmptyModuleFinder.Instance;
17
109 public static IModuleFinder Create(ImmutableArray<string> entries)
110 {
111 if (entries.IsDefault)
112 throw new ArgumentNullException(nameof(entries));
113
114 if (entries.Length == 0)
115 return EmptyModuleFinder.Instance;
116 else
117 return ModulePath.Create(entries);
118 }
119
130 public static IModuleFinder Compose(ImmutableArray<IModuleFinder> finders)
131 {
132 if (finders.Length == 0)
133 return EmptyModuleFinder.Instance;
134 else
135 return new ComposableModuleFinder(finders);
136 }
137
139 public abstract ModuleReference? Find(string name);
140
142 public abstract ImmutableHashSet<ModuleReference> FindAll();
143
144 }
145
146}