public final Operation createAndRegisterOperation(final String namedIdentifier, final ComponentType componentType, final Signature signature) { if (this.operationsByName.containsKey(namedIdentifier)) { throw new IllegalArgumentException("Element with name " + namedIdentifier + "exists already"); } final int id = this.getAndIncrementNextId(); final Operation newInst = new Operation(id, componentType, signature); this.operationsById.put(id, newInst); this.operationsByName.put(namedIdentifier, newInst); return newInst; }
Operation op = systemModelRepository.getOperationFactory().lookupOperationByNamedIdentifier(operationFactoryName); if (op == null) { // Operation doesn't exist op = systemModelRepository.getOperationFactory() .createAndRegisterOperation(operationFactoryName, allocInst.getAssemblyComponent().getType(), operationSignature); allocInst.getAssemblyComponent().getType().addOperation(op);
/** * Creates a new instance of this class using the given parameters. * * @param configuration * The configuration to use for this repository. * @param projectContext * The project context to use for this repository. */ public SystemModelRepository(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.typeRepositoryFactory = new TypeRepository(this); this.assemblyFactory = new AssemblyRepository(this); this.executionEnvironmentFactory = new ExecutionEnvironmentRepository(this); this.allocationFactory = new AllocationRepository(this); this.operationFactory = new OperationRepository(this); this.allocationPairFactory = new AllocationComponentOperationPairFactory(this); this.assemblyPairFactory = new AssemblyComponentOperationPairFactory(this); }
this.printLinebreak(ps); this.printOpenHtmlTable(ps, "Operations", new String[] { "ID", "Component type", "Name", "Parameter types", "Return type" }); final Collection<Operation> operations = this.operationFactory.getOperations(); for (final Operation op : operations) { final StringBuilder paramListStrBuild = new StringBuilder();
Operation operationAa = this.systemEntityFactory.getOperationFactory().lookupOperationByNamedIdentifier(operationName); if (operationAa == null) { operationAa = this.systemEntityFactory.getOperationFactory().createAndRegisterOperation( operationName, componentTypeA, new Signature(operationName, modifierList, returnType, paramTypeList));