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
.lttng
.ui
.views
.control
.model
.impl
;
14 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.model
.IEventInfo
;
15 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.model
.TraceEnablement
;
18 * <b><u>EventInfo</u></b>
20 * Implementation of the trace event interface (IEventInfo) to store event
24 public class EventInfo
extends BaseEventInfo
implements IEventInfo
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
30 * The enable state of the event.
32 private TraceEnablement fState
= TraceEnablement
.DISABLED
;
34 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
39 * @param name - name of event
41 public EventInfo(String name
) {
47 * @param other - the instance to copy
49 public EventInfo(EventInfo other
) {
51 fState
= other
.fState
;
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 * @see org.eclipse.linuxtools.internal.lttng.ui.views.control.model.IEventInfo#getState()
62 public TraceEnablement
getState() {
68 * @see org.eclipse.linuxtools.internal.lttng.ui.views.control.model.IEventInfo#setState(org.eclipse.linuxtools.internal.lttng.ui.views.control.model.TraceEnablement)
71 public void setState(TraceEnablement state
) {
77 * @see org.eclipse.linuxtools.internal.lttng.ui.views.control.model.ITraceInfo#formatString()
79 @SuppressWarnings("nls")
81 public String
formatString() {
82 StringBuffer output
= new StringBuffer();
83 // ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint) [enabled]");
84 output
.append(super.formatString());
86 output
.append(fState
.getInName());
88 return output
.toString();
93 * @see org.eclipse.linuxtools.internal.lttng.ui.views.control.model.IEventInfo#setState(java.lang.String)
96 public void setState(String stateName
) {
97 fState
= TraceEnablement
.DISABLED
;
98 if (TraceEnablement
.DISABLED
.getInName().equals(stateName
)) {
99 fState
= TraceEnablement
.DISABLED
;
100 } else if (TraceEnablement
.ENABLED
.getInName().equals(stateName
)) {
101 fState
= TraceEnablement
.ENABLED
;
107 * @see org.eclipse.linuxtools.internal.lttng.ui.views.control.model.impl.BaseEventInfo#hashCode()
110 public int hashCode() {
111 final int prime
= 31;
112 int result
= super.hashCode();
113 result
= prime
* result
+ ((fState
== null) ?
0 : (fState
.ordinal() + 1));
119 * @see org.eclipse.linuxtools.internal.lttng.ui.views.control.model.impl.BaseEventInfo#equals(java.lang.Object)
122 public boolean equals(Object obj
) {
126 if (!super.equals(obj
)) {
129 if (getClass() != obj
.getClass()) {
132 EventInfo other
= (EventInfo
) obj
;
133 if (fState
!= other
.fState
) {
141 * @see org.eclipse.linuxtools.internal.lttng.ui.views.control.model.impl.BaseEventInfo#toString()
143 @SuppressWarnings("nls")
145 public String
toString() {
146 StringBuffer output
= new StringBuffer();
147 output
.append("[EventInfo(");
148 output
.append(super.toString());
149 output
.append(",State=");
150 output
.append(fState
);
152 return output
.toString();
This page took 0.041505 seconds and 5 git commands to generate.