/** * Creates a new assembly component instance and registers it as well. * * @param namedIdentifier * The identifier of the new component. * @param componentType * The new component type. * * @return The newly created assembly component. */ public final AssemblyComponent createAndRegisterAssemblyComponentInstance(final String namedIdentifier, final ComponentType componentType) { if (this.assemblyComponentInstancesByName.containsKey(namedIdentifier)) { throw new IllegalArgumentException("Element with name " + namedIdentifier + "exists already"); } final int id = this.getAndIncrementNextId(); final AssemblyComponent newInst = new AssemblyComponent(id, "@" + id, componentType); this.assemblyComponentInstancesById.put(id, newInst); this.assemblyComponentInstancesByName.put(namedIdentifier, newInst); return newInst; }