/** Order traces by tins */ @Override public int compare(final ExecutionTrace t1, final ExecutionTrace t2) { if (t1 == t2) { // NOPMD (no equals) return 0; } final long t1LowestTin = t1.getTraceAsSortedExecutionSet().first().getTin(); final long t2LowestTin = t2.getTraceAsSortedExecutionSet().first().getTin(); // Multiple traces may have an equal tin timestamp value. In order to provide an absolute ordering of the keys, we take the traceId as a second ordering // key. if (t1LowestTin != t2LowestTin) { return t1LowestTin < t2LowestTin ? -1 : 1; // NOCS } return t1.getTraceId() < t2.getTraceId() ? -1 : 1; // NOCS } });
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if ((obj == null) || !(obj instanceof AbstractExecutionTraceHashContainer)) { return false; } final ExecutionTrace otherTrace = ((AbstractExecutionTraceHashContainer) obj).getExecutionTrace(); if (super.getExecutionTrace().getLength() != otherTrace.getLength()) { return false; } final Iterator<Execution> otherIterator = otherTrace.getTraceAsSortedExecutionSet().iterator(); for (final Execution r1 : super.getExecutionTrace().getTraceAsSortedExecutionSet()) { final Execution r2 = otherIterator.next(); if (!this.executionsEqual(r1, r2)) { return false; } } return true; } }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if ((obj == null) || !(obj instanceof AbstractExecutionTraceHashContainer)) { return false; } final ExecutionTrace otherTrace = ((AbstractExecutionTraceHashContainer) obj).getExecutionTrace(); if (super.getExecutionTrace().getLength() != otherTrace.getLength()) { return false; } final Iterator<Execution> otherIterator = otherTrace.getTraceAsSortedExecutionSet().iterator(); for (final Execution r1 : super.getExecutionTrace().getTraceAsSortedExecutionSet()) { final Execution r2 = otherIterator.next(); if (!this.executionsEqual(r1, r2)) { return false; } } return true; } }
/** * 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; }
/** * 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 Execution curExec : invalidExecutionTrace.getTraceAsSortedExecutionSet()) { reader.addObject(curExec);
for (final Execution curExec : incompleteExecutionTrace.getTraceAsSortedExecutionSet()) { reader.addObject(curExec);
for (final Execution curExec : validExecutionTrace.getTraceAsSortedExecutionSet()) { reader.addObject(curExec);
for (final Execution execFromTrace0 : trace0.getTraceAsSortedExecutionSet()) { final Execution execToAddToTrace1; if (execFromTrace0 == this.exec0_0__bookstore_searchBook) {