analysis.lami: Implementation of LAMI plugins
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.lami.core / src / org / eclipse / tracecompass / internal / provisional / analysis / lami / core / module / LamiXYSeriesDescription.java
1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Jonathan Rajotte-Julien
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
10 package org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module;
11
12 import java.util.Objects;
13
14 import org.eclipse.jdt.annotation.Nullable;
15 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect;
16
17 /**
18 * Description of a series to use in LAMI charts.
19 *
20 * Contains the aspects to use on the X and Y axes (one per axis).
21 *
22 * @author Jonathan Rajotte-Julien
23 */
24 public class LamiXYSeriesDescription {
25
26 private final LamiTableEntryAspect fXAspect;
27 private final LamiTableEntryAspect fYAspect;
28
29 /**
30 * Constructor
31 *
32 * @param xAspect
33 * The aspect to use on the X axis
34 * @param yAspect
35 * The aspect to use on the Y axis
36 */
37 public LamiXYSeriesDescription(LamiTableEntryAspect xAspect, LamiTableEntryAspect yAspect) {
38 fXAspect = xAspect;
39 fYAspect = yAspect;
40 }
41
42 /**
43 * Get the aspect corresponding to the X axis.
44 *
45 * @return The X-axis aspect
46 */
47 public LamiTableEntryAspect getXAspect() {
48 return fXAspect;
49 }
50
51 /**
52 * Get the aspect corresponding to the Y axis.
53 *
54 * @return The Y-axis aspect
55 */
56 public LamiTableEntryAspect getYAspect() {
57 return fYAspect;
58 }
59
60
61 @Override
62 public String toString() {
63 return "x:" + fXAspect.getLabel() + " y:" + fYAspect.getLabel(); //$NON-NLS-1$ //$NON-NLS-2$
64 }
65
66 @Override
67 public int hashCode() {
68 return Objects.hash(fXAspect, fYAspect);
69 }
70
71 @Override
72 public boolean equals(@Nullable Object obj) {
73 if (this == obj) {
74 return true;
75 }
76 if (obj == null) {
77 return false;
78 }
79 if (getClass() != obj.getClass()) {
80 return false;
81 }
82 LamiXYSeriesDescription other = (LamiXYSeriesDescription) obj;
83 if (!fXAspect.equals(other.fXAspect)) {
84 return false;
85 }
86 if (!fYAspect.equals(other.fYAspect)) {
87 return false;
88 }
89 return true;
90 }
91
92 }
This page took 0.031219 seconds and 5 git commands to generate.