1 /**********************************************************************
2 * Copyright (c) 2012 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
.ui
.views
.control
.model
.impl
;
14 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.IProbeEventInfo
;
17 * <b><u>ProbleEventInfo</u></b>
19 * Implementation of the trace event interface (IProbeEventInfo) to store probe event
23 public class ProbeEventInfo
extends EventInfo
implements IProbeEventInfo
{
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 * The dynamic probe address (null if symbol is used).
31 private String fAddress
;
33 * The dynamic probe offset (if symbol is used).
35 private String fOffset
;
38 * The symbol name (null if address is used)
40 private String fSymbol
;
43 // ------------------------------------------------------------------------
45 // ------------------------------------------------------------------------
48 * @param name - name of event
50 public ProbeEventInfo(String name
) {
56 * @param other - the instance to copy
58 public ProbeEventInfo(ProbeEventInfo other
) {
60 fAddress
= other
.fAddress
;
61 fOffset
= other
.fOffset
;
62 fSymbol
= other
.fSymbol
;
65 // ------------------------------------------------------------------------
67 // ------------------------------------------------------------------------
71 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IProbeEventInfo#getAddress()
74 public String
getAddress() {
80 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IProbeEventInfo#setAddress(java.lang.String)
83 public void setAddress(String address
) {
89 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IProbeEventInfo#getOffset()
92 public String
getOffset() {
98 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IProbeEventInfo#setOffset(java.lang.String)
101 public void setOffset(String offset
) {
107 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IProbeEventInfo#getSymbol()
110 public String
getSymbol() {
116 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IProbeEventInfo#setSymbol(java.lang.String)
119 public void setSymbol(String symbol
) {
123 // ------------------------------------------------------------------------
125 // ------------------------------------------------------------------------
128 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceInfo#formatString()
130 @SuppressWarnings("nls")
132 public String
formatString() {
133 StringBuffer output
= new StringBuffer();
134 // name (type: probe) [enabled]");
136 output
.append(super.formatString());
137 if (fAddress
!= null) {
138 output
.append("\n addr: ");
139 output
.append(fAddress
);
141 output
.append("\n offset: ");
142 output
.append(fOffset
);
144 output
.append(" symbol: ");
145 output
.append(fSymbol
);
147 return output
.toString();
152 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventInfo#hashCode()
155 public int hashCode() {
156 final int prime
= 31;
157 int result
= super.hashCode();
158 result
= prime
* result
+ ((fAddress
== null) ?
0 : fAddress
.hashCode());
159 result
= prime
* result
+ ((fOffset
== null) ?
0 : fOffset
.hashCode());
160 result
= prime
* result
+ ((fSymbol
== null) ?
0 : fSymbol
.hashCode());
166 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventInfo#equals(java.lang.Object)
169 public boolean equals(Object obj
) {
173 if (!super.equals(obj
)) {
176 if (getClass() != obj
.getClass()) {
179 ProbeEventInfo other
= (ProbeEventInfo
) obj
;
180 if (fAddress
== null) {
181 if (other
.fAddress
!= null) {
184 } else if (!fAddress
.equals(other
.fAddress
)) {
187 if (fOffset
== null) {
188 if (other
.fOffset
!= null) {
191 } else if (!fOffset
.equals(other
.fOffset
)) {
194 if (fSymbol
== null) {
195 if (other
.fSymbol
!= null) {
198 } else if (!fSymbol
.equals(other
.fSymbol
)) {
207 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.EventInfo#toString()
209 @SuppressWarnings("nls")
211 public String
toString() {
212 StringBuffer output
= new StringBuffer();
213 output
.append("[ProbeEventInfo(");
214 output
.append(super.toString());
215 if (fAddress
!= null) {
216 output
.append(",fAddress=");
217 output
.append(fAddress
);
219 output
.append(",fOffset=");
220 output
.append(fOffset
);
221 output
.append(",fSymbol=");
222 output
.append(fSymbol
);
225 return output
.toString();
This page took 0.03674 seconds and 5 git commands to generate.