1 /**********************************************************************
2 * Copyright (c) 2012, 2014 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 **********************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.impl
;
15 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.IEventInfo
;
16 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.core
.model
.IProbeEventInfo
;
19 * Implementation of the trace event interface (IProbeEventInfo) to store probe
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
;
43 // ------------------------------------------------------------------------
45 // ------------------------------------------------------------------------
52 public ProbeEventInfo(String name
) {
60 * - the instance to copy
62 public ProbeEventInfo(ProbeEventInfo other
) {
64 fAddress
= other
.fAddress
;
65 fOffset
= other
.fOffset
;
66 fSymbol
= other
.fSymbol
;
70 * Constructor from a {@link IEventInfo}
73 * - the instance to copy
75 public ProbeEventInfo(IEventInfo eventInfo
) {
76 super(eventInfo
.getName());
77 setState(eventInfo
.getState());
78 setLogLevelType(eventInfo
.getLogLevelType());
79 setLogLevel(eventInfo
.getLogLevel());
80 setFilterExpression(eventInfo
.getFilterExpression());
81 setEventType(eventInfo
.getEventType());
84 // ------------------------------------------------------------------------
86 // ------------------------------------------------------------------------
89 public String
getAddress() {
94 public void setAddress(String address
) {
99 public String
getOffset() {
104 public void setOffset(String offset
) {
109 public String
getSymbol() {
114 public void setSymbol(String symbol
) {
118 // ------------------------------------------------------------------------
120 // ------------------------------------------------------------------------
123 public int hashCode() {
124 final int prime
= 31;
125 int result
= super.hashCode();
126 result
= prime
* result
+ ((fAddress
== null) ?
0 : fAddress
.hashCode());
127 result
= prime
* result
+ ((fOffset
== null) ?
0 : fOffset
.hashCode());
128 result
= prime
* result
+ ((fSymbol
== null) ?
0 : fSymbol
.hashCode());
133 public boolean equals(Object obj
) {
137 if (!super.equals(obj
)) {
140 if (getClass() != obj
.getClass()) {
143 ProbeEventInfo other
= (ProbeEventInfo
) obj
;
144 if (fAddress
== null) {
145 if (other
.fAddress
!= null) {
148 } else if (!fAddress
.equals(other
.fAddress
)) {
151 if (fOffset
== null) {
152 if (other
.fOffset
!= null) {
155 } else if (!fOffset
.equals(other
.fOffset
)) {
158 if (fSymbol
== null) {
159 if (other
.fSymbol
!= null) {
162 } else if (!fSymbol
.equals(other
.fSymbol
)) {
168 @SuppressWarnings("nls")
170 public String
toString() {
171 StringBuffer output
= new StringBuffer();
172 output
.append("[ProbeEventInfo(");
173 output
.append(super.toString());
174 if (fAddress
!= null) {
175 output
.append(",fAddress=");
176 output
.append(fAddress
);
178 output
.append(",fOffset=");
179 output
.append(fOffset
);
180 output
.append(",fSymbol=");
181 output
.append(fSymbol
);
184 return output
.toString();
This page took 0.036517 seconds and 6 git commands to generate.