@Override public String toString() { return +this.allocationComponent.getId() + ":" + this.operation.getId() + "@" + this.id; }
/** * Utility function to create a textual node ID for an operation. * * @param operation * The operation to create the ID for * @return The created ID */ protected static String createOperationNodeId(final Operation operation) { return AbstractDependencyGraphFormatter.createNodeId(operation.getId()); }
@Override public String toString() { return +this.assemblyComponent.getId() + ":" + this.operation.getId() + "@" + this.id; }
@Override public String toString() { final StringBuilder strBuild = new StringBuilder(); strBuild.append(this.timestamp) .append(' '); if (this.getSendingExecution().getOperation().getId() == Operation.ROOT_OPERATION_ID) { strBuild.append(SystemModelRepository.ROOT_NODE_LABEL); } else { strBuild.append(this.getSendingExecution()); } strBuild.append(" --> "); if (this.getReceivingExecution().getOperation().getId() == Operation.ROOT_OPERATION_ID) { strBuild.append(SystemModelRepository.ROOT_NODE_LABEL); } else { strBuild.append(this.getReceivingExecution()); } return strBuild.toString(); }
/** * Creates a new pair using both elements and registers it was well. * * @param operation * The second element of the pair (the operation). * @param allocationComponent * The first element of the pair (the allocation component). * * @return The newly created pair. */ private final AllocationComponentOperationPair createAndRegisterPair(final Operation operation, final AllocationComponent allocationComponent) { return this.createAndRegisterPair(allocationComponent.getId() + "-" + operation.getId(), operation, allocationComponent); }
/** * Returns a corresponding pair instance (existing or newly created). * * @param allocationComponent * The first element of the pair (the allocation component). * @param operation * The second element of the pair (the operation). * * @return A (possible new) pair containing both elements. */ public final AllocationComponentOperationPair getPairInstanceByPair(final AllocationComponent allocationComponent, final Operation operation) { final AllocationComponentOperationPair inst = this.getPairByNamedIdentifier(allocationComponent.getId() + "-" + operation.getId()); if (inst == null) { return this.createAndRegisterPair(operation, allocationComponent); } return inst; }
/** * Returns a corresponding pair instance (existing or newly created). * * @param assemblyComponent * The assemble component for the pair. * @param operation * The operation for the pair. * * @return The corresponding pair instance if it exists, otherwise a new one. */ public final AssemblyComponentOperationPair getPairInstanceByPair(final AssemblyComponent assemblyComponent, final Operation operation) { final String namedIdentifier = assemblyComponent.getId() + "-" + operation.getId(); final AssemblyComponentOperationPair inst = this.getPairByNamedIdentifier(namedIdentifier); if (inst == null) { return this.createAndRegisterPair(namedIdentifier, operation, assemblyComponent); } return inst; }
/** * Checks whether the given executions are equal or not. * * @param r1 * The first execution object. * @param r2 * The second execution object. * * @return true if and only if the executions have the same values. */ private boolean executionsEqual(final Execution r1, final Execution r2) { if (r1 == r2) { // NOPMD (no equals) return true; } if ((r1 == null) || (r2 == null)) { return false; } return (r1.getAllocationComponent().getId() == r2.getAllocationComponent().getId()) && (r1.getOperation().getId() == r2.getOperation().getId()) && (r1.getEoi() == r2.getEoi()) && (r1.getEss() == r2.getEss()); }
/** * Creates a new instance of this class using the given parameters. * * @param t * The execution trace to be stored in this container. */ public ExecutionTraceHashContainerAllocationEquivalence(final ExecutionTrace t) { super(t); final int prime = 31; int result = 1; for (final Execution r : t.getTraceAsSortedExecutionSet()) { result = (prime * result) + r.getOperation().getId(); result = (prime * result) + r.getAllocationComponent().getId(); result = (prime * result) + r.getEoi(); result = (prime * result) + r.getEss(); } // this.hashcodeBuffer = result; }
/** * Checks whether the given executions are equal or not. * * @param r1 * The first execution object. * @param r2 * The second execution object. * * @return true if and only if the executions have the same values. */ private boolean executionsEqual(final Execution r1, final Execution r2) { if (r1 == r2) { // NOPMD (no equals) return true; } if ((r1 == null) || (r2 == null)) { return false; } return (r1.getAllocationComponent().getAssemblyComponent().getId() == r2.getAllocationComponent().getAssemblyComponent().getId()) && (r1.getOperation().getId() == r2.getOperation().getId()) && (r1.getEoi() == r2.getEoi()) && (r1.getEss() == r2.getEss()); }
/** * Creates a new instance of this class using the given parameters. * * @param t * The execution trace to be stored in this container. */ public ExecutionTraceHashContainerAssemblyEquivalence(final ExecutionTrace t) { super(t); final int prime = 31; int result = 1; for (final Execution r : t.getTraceAsSortedExecutionSet()) { result = (prime * result) + r.getOperation().getId(); result = (prime * result) + r.getAllocationComponent().getAssemblyComponent().getId(); result = (prime * result) + r.getEoi(); result = (prime * result) + r.getEss(); } // this.hashCodeBuffer = result; }
for (final Operation op : type.getOperations()) { opListBuilder.append("<li>") .append(this.htmlEntityRef(op.getId(), SystemModelRepository.simpleHTMLEscape(op.getSignature().toString()), EntityType.OPERATION)) .append("</li>"); this.htmlEntityLabel(op.getId(), Integer.toString(op.getId()), EntityType.OPERATION), this.htmlEntityRef(op.getComponentType().getId(), SystemModelRepository.simpleHTMLEscape(op.getComponentType().getFullQualifiedName()), EntityType.COMPONENT_TYPE),
final int rootOperationId = OperationRepository.ROOT_OPERATION.getId(); final Operation senderOperation = m.getSendingExecution().getOperation(); final Operation receiverOperation = m.getReceivingExecution().getOperation(); if (senderOperation.getId() == rootOperationId) { senderPair = this.getGraph().getRootNode().getEntity(); } else { if (receiverOperation.getId() == rootOperationId) { receiverPair = this.getGraph().getRootNode().getEntity(); } else {
final int rootOperationId = OperationRepository.ROOT_OPERATION.getId(); final Operation senderOperation = m.getSendingExecution().getOperation(); final Operation receiverOperation = m.getReceivingExecution().getOperation(); if (senderOperation.getId() == rootOperationId) { senderPair = this.getGraph().getRootNode().getEntity(); } else { if (receiverOperation.getId() == rootOperationId) { receiverPair = this.getGraph().getRootNode().getEntity(); } else {