25e0c4838aa6b14ee1d424aaa9dcdfb0e2dd5844
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.graph.core.tests / stubs / org / eclipse / tracecompass / analysis / graph / core / tests / stubs / TestGraphWorker.java
1 /*******************************************************************************
2 * Copyright (c) 2015 École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.analysis.graph.core.tests.stubs;
14
15 import org.eclipse.jdt.annotation.Nullable;
16 import org.eclipse.tracecompass.analysis.graph.core.base.IGraphWorker;
17
18 /**
19 * A stub graph worker for unit tests
20 *
21 * @author Geneviève Bastien
22 */
23 public class TestGraphWorker implements IGraphWorker {
24
25 private final Integer fValue;
26
27 /**
28 * Constructor
29 *
30 * @param i An integer to represent this worker
31 */
32 public TestGraphWorker(final Integer i) {
33 fValue = i;
34 }
35
36 @Override
37 public String getHostId() {
38 return "test";
39 }
40
41 @Override
42 public int hashCode() {
43 return fValue.hashCode();
44 }
45
46 @Override
47 public boolean equals(@Nullable Object obj) {
48 if (obj instanceof TestGraphWorker) {
49 return fValue.equals(((TestGraphWorker) obj).fValue);
50 }
51 return false;
52 }
53 }
This page took 0.039614 seconds and 5 git commands to generate.