1 /**********************************************************************
2 * Copyright (c) 2012, 2013 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.impl
;
14 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.IProbeEventInfo
;
18 * Implementation of the trace event interface (IProbeEventInfo) to store probe event
22 * @author Bernd Hufmann
24 public class ProbeEventInfo
extends EventInfo
implements IProbeEventInfo
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
30 * The dynamic probe address (null if symbol is used).
32 private String fAddress
;
34 * The dynamic probe offset (if symbol is used).
36 private String fOffset
;
39 * The symbol name (null if address is used)
41 private String fSymbol
;
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
49 * @param name - name of event
51 public ProbeEventInfo(String name
) {
57 * @param other - the instance to copy
59 public ProbeEventInfo(ProbeEventInfo other
) {
61 fAddress
= other
.fAddress
;
62 fOffset
= other
.fOffset
;
63 fSymbol
= other
.fSymbol
;
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
71 public String
getAddress() {
76 public void setAddress(String address
) {
81 public String
getOffset() {
86 public void setOffset(String offset
) {
91 public String
getSymbol() {
96 public void setSymbol(String symbol
) {
100 // ------------------------------------------------------------------------
102 // ------------------------------------------------------------------------
105 public int hashCode() {
106 final int prime
= 31;
107 int result
= super.hashCode();
108 result
= prime
* result
+ ((fAddress
== null) ?
0 : fAddress
.hashCode());
109 result
= prime
* result
+ ((fOffset
== null) ?
0 : fOffset
.hashCode());
110 result
= prime
* result
+ ((fSymbol
== null) ?
0 : fSymbol
.hashCode());
115 public boolean equals(Object obj
) {
119 if (!super.equals(obj
)) {
122 if (getClass() != obj
.getClass()) {
125 ProbeEventInfo other
= (ProbeEventInfo
) obj
;
126 if (fAddress
== null) {
127 if (other
.fAddress
!= null) {
130 } else if (!fAddress
.equals(other
.fAddress
)) {
133 if (fOffset
== null) {
134 if (other
.fOffset
!= null) {
137 } else if (!fOffset
.equals(other
.fOffset
)) {
140 if (fSymbol
== null) {
141 if (other
.fSymbol
!= null) {
144 } else if (!fSymbol
.equals(other
.fSymbol
)) {
150 @SuppressWarnings("nls")
152 public String
toString() {
153 StringBuffer output
= new StringBuffer();
154 output
.append("[ProbeEventInfo(");
155 output
.append(super.toString());
156 if (fAddress
!= null) {
157 output
.append(",fAddress=");
158 output
.append(fAddress
);
160 output
.append(",fOffset=");
161 output
.append(fOffset
);
162 output
.append(",fSymbol=");
163 output
.append(fSymbol
);
166 return output
.toString();
This page took 0.035043 seconds and 5 git commands to generate.