/** * Utility function to create a textual container ID for an allocation component. * * @param component * The allocation component to create the ID for * @return The created ID */ protected static String createAllocationComponentId(final AllocationComponent component) { return COMPONENT_NODE_ID_PREFIX + component.getId(); }
@Override public String toString() { return +this.allocationComponent.getId() + ":" + this.operation.getId() + "@" + this.id; }
/** * 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; }
final String rootDotId = "O" + rootAllocationComponent.getId(); ps.print("actor(O" + rootAllocationComponent.getId() + ",\"\");" + "\n"); plottedComponentIds.add(rootAllocationComponent.getId()); final AllocationComponent senderComponent = me.getSendingExecution().getAllocationComponent(); final AllocationComponent receiverComponent = me.getReceivingExecution().getAllocationComponent(); if (!plottedComponentIds.contains(senderComponent.getId())) { ps.print("object(O" + senderComponent.getId() + ",\"" + senderComponent.getExecutionContainer().getName() + "::\",\"" + SequenceDiagramFilter.allocationComponentLabel(senderComponent, shortLabels) + "\");" + "\n"); plottedComponentIds.add(senderComponent.getId()); if (!plottedComponentIds.contains(receiverComponent.getId())) { ps.print("object(O" + receiverComponent.getId() + ",\"" + receiverComponent.getExecutionContainer().getName() + "::\",\"" + SequenceDiagramFilter.allocationComponentLabel(receiverComponent, shortLabels) + "\");" + "\n"); plottedComponentIds.add(receiverComponent.getId()); final AllocationComponent senderComponent = me.getSendingExecution().getAllocationComponent(); final AllocationComponent receiverComponent = me.getReceivingExecution().getAllocationComponent(); senderDotId = "O" + senderComponent.getId(); receiverDotId = "O" + receiverComponent.getId(); } else if (sdMode == SDModes.ASSEMBLY) { final AssemblyComponent senderComponent = me.getSendingExecution().getAllocationComponent().getAssemblyComponent();
/** * 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; }
for (final AllocationComponent allocationComponent : allocationComponentInstances) { final String[] cells = new String[] { this.htmlEntityLabel(allocationComponent.getId(), Integer.toString(allocationComponent.getId()), EntityType.ALLOCATION_COMPONENT), this.htmlEntityRef(allocationComponent.getAssemblyComponent().getId(),
DependencyGraphNode<AllocationComponent> senderNode = this.getGraph().getNode(senderComponent.getId()); DependencyGraphNode<AllocationComponent> receiverNode = this.getGraph().getNode(receiverComponent.getId()); senderNode = new DependencyGraphNode<>(senderComponent.getId(), senderComponent, t.getTraceInformation(), this.getOriginRetentionPolicy()); receiverNode = new DependencyGraphNode<>(receiverComponent.getId(), receiverComponent, t.getTraceInformation(), this.getOriginRetentionPolicy());