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
.lttng
.ui
.views
.control
.model
.impl
;
14 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.IEventInfo
;
15 import org
.eclipse
.linuxtools
.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.lttng.ui.views.control.model.IEventInfo#getState()
62 public TraceEnablement
getState() {
68 * @see org.eclipse.linuxtools.lttng.ui.views.control.model.IEventInfo#setState(org.eclipse.linuxtools.lttng.ui.views.control.model.TraceEnablement)
71 public void setState(TraceEnablement state
) {
77 * @see org.eclipse.linuxtools.lttng.ui.views.control.model.IEventInfo#setState(java.lang.String)
80 public void setState(String stateName
) {
81 fState
= TraceEnablement
.DISABLED
;
82 if (TraceEnablement
.DISABLED
.getInName().equals(stateName
)) {
83 fState
= TraceEnablement
.DISABLED
;
84 } else if (TraceEnablement
.ENABLED
.getInName().equals(stateName
)) {
85 fState
= TraceEnablement
.ENABLED
;
91 * @see org.eclipse.linuxtools.lttng.ui.views.control.model.impl.BaseEventInfo#hashCode()
94 public int hashCode() {
96 result
= 37 * result
+ super.hashCode();
97 result
= 37 * result
+ fState
.ordinal();
103 * @see org.eclipse.linuxtools.lttng.ui.views.control.model.impl.BaseEventInfo#equals(java.lang.Object)
106 public boolean equals(Object other
) {
107 if (!(other
instanceof EventInfo
)) {
111 EventInfo otherInfo
= (EventInfo
) other
;
112 if (!super.equals(otherInfo
)) {
116 if (fState
.ordinal() != otherInfo
.fState
.ordinal()) {
125 * @see org.eclipse.linuxtools.lttng.ui.views.control.model.impl.BaseEventInfo#toString()
127 @SuppressWarnings("nls")
129 public String
toString() {
130 StringBuffer output
= new StringBuffer();
131 output
.append("[EventInfo(");
132 output
.append(super.toString());
133 output
.append(",State=");
134 output
.append(fState
);
136 return output
.toString();
This page took 0.033654 seconds and 6 git commands to generate.