357c509f4a252bf929f3bc8bd6d2d6f5fb3e7d58
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());
83 // ------------------------------------------------------------------------
85 // ------------------------------------------------------------------------
88 public String
getAddress() {
93 public void setAddress(String address
) {
98 public String
getOffset() {
103 public void setOffset(String offset
) {
108 public String
getSymbol() {
113 public void setSymbol(String symbol
) {
117 // ------------------------------------------------------------------------
119 // ------------------------------------------------------------------------
122 public int hashCode() {
123 final int prime
= 31;
124 int result
= super.hashCode();
125 result
= prime
* result
+ ((fAddress
== null) ?
0 : fAddress
.hashCode());
126 result
= prime
* result
+ ((fOffset
== null) ?
0 : fOffset
.hashCode());
127 result
= prime
* result
+ ((fSymbol
== null) ?
0 : fSymbol
.hashCode());
132 public boolean equals(Object obj
) {
136 if (!super.equals(obj
)) {
139 if (getClass() != obj
.getClass()) {
142 ProbeEventInfo other
= (ProbeEventInfo
) obj
;
143 if (fAddress
== null) {
144 if (other
.fAddress
!= null) {
147 } else if (!fAddress
.equals(other
.fAddress
)) {
150 if (fOffset
== null) {
151 if (other
.fOffset
!= null) {
154 } else if (!fOffset
.equals(other
.fOffset
)) {
157 if (fSymbol
== null) {
158 if (other
.fSymbol
!= null) {
161 } else if (!fSymbol
.equals(other
.fSymbol
)) {
167 @SuppressWarnings("nls")
169 public String
toString() {
170 StringBuffer output
= new StringBuffer();
171 output
.append("[ProbeEventInfo(");
172 output
.append(super.toString());
173 if (fAddress
!= null) {
174 output
.append(",fAddress=");
175 output
.append(fAddress
);
177 output
.append(",fOffset=");
178 output
.append(fOffset
);
179 output
.append(",fSymbol=");
180 output
.append(fSymbol
);
183 return output
.toString();
This page took 0.052634 seconds and 4 git commands to generate.