Class Modules<T extends Module>
java.lang.Object
org.ek9lang.compiler.Modules<T>
- All Implemented Interfaces:
Serializable
With EK9 it is possible to have multiple source files that are all in the same 'module'.
This object represents that concept. So the module name is always the same but there can and
will be multiple modules.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Modules
-
-
Method Details
-
add
Add a module to the set all under the same moduleName. -
remove
Remove an existing module for the set of modules recorded against a specific module name. -
getModules
Provides an immutable snapshot of the parsed modules.Returns
List.copyOf(Collection)rather thanCollections.unmodifiableList(List)because callers obtain this list while inside aSharedThreadContext.accept(...)lock but may iterate it after the lock is released. An unmodifiable view shares the backing array with this object'smodulesInModule, so a concurrentadd(T)(legitimately running under the lock in another scheduled accept call) can mutate the backing array and surface as aConcurrentModificationExceptionin the earlier caller's iteration. A snapshot taken at the call site is consistent and insulates the caller from later mutations.
-