diff --git a/src/de/inetsoftware/jwebassembly/module/TypeManager.java b/src/de/inetsoftware/jwebassembly/module/TypeManager.java index 476918f..bc5cf54 100644 --- a/src/de/inetsoftware/jwebassembly/module/TypeManager.java +++ b/src/de/inetsoftware/jwebassembly/module/TypeManager.java @@ -16,7 +16,11 @@ */ package de.inetsoftware.jwebassembly.module; -import java.util.HashMap; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; + +import javax.annotation.Nonnull; import de.inetsoftware.jwebassembly.wasm.StorageType; @@ -27,7 +31,7 @@ import de.inetsoftware.jwebassembly.wasm.StorageType; */ class TypeManager { - private final HashMap map = new HashMap<>(); + private final Map map = new LinkedHashMap<>(); /** * Use the type in the output. @@ -48,6 +52,16 @@ class TypeManager { } } + /** + * Get the registered types in numeric order. + * + * @return the types + */ + @Nonnull + Collection getTypes() { + return map.values(); + } + /** * A reference to a type. * @@ -76,5 +90,13 @@ class TypeManager { public int getCode() { return code; } + + /** + * Get the name of the Java type + * @return the name + */ + public String getName() { + return name; + } } }