Monster fix: TMF model update + corresponding LTTng adaptations + JUnits
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / event / TmfEventField.java
1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.event;
14
15 /**
16 * <b><u>TmfEventField</u></b>
17 * <p>
18 * A basic event field.
19 *
20 * TODO: Add support for field hierarchy.
21 */
22 public class TmfEventField implements Cloneable {
23
24 // ========================================================================
25 // Attributes
26 // ========================================================================
27
28 private final TmfEventContent fParent;
29 private final String fFieldId;
30 private Object fValue;
31
32 // ========================================================================
33 // Constructors
34 // ========================================================================
35
36 /**
37 * @param parent
38 * @param id
39 * @param value
40 */
41 public TmfEventField(TmfEventContent parent, String id, Object value) {
42 fParent = parent;
43 fFieldId = id;
44 fValue = value;
45 }
46
47 /**
48 * @param other
49 */
50 public TmfEventField(TmfEventField other) {
51 assert(other != null);
52 fParent = other.fParent;
53 fFieldId = other.fFieldId;
54 fValue = other.fValue;
55 }
56
57 @SuppressWarnings("unused")
58 private TmfEventField() {
59 fParent = null;
60 fFieldId = null;
61 fValue = null;
62 }
63
64 // ========================================================================
65 // Accessors
66 // ========================================================================
67
68 /**
69 * @return
70 */
71 public TmfEventContent getParent() {
72 return fParent;
73 }
74
75 /**
76 * @return
77 */
78 public String getId() {
79 return fFieldId;
80 }
81
82 /**
83 * @return
84 */
85 public Object getValue() {
86 return fValue;
87 }
88
89 /**
90 * @param value
91 */
92 protected void setValue(Object value) {
93 fValue = value;
94 }
95
96 // ========================================================================
97 // Operators
98 // ========================================================================
99
100 /**
101 * Clone: shallow copy by default; override for deep copy.
102 */
103 @Override
104 public TmfEventField clone() {
105 return new TmfEventField(this);
106 }
107
108 @Override
109 public String toString() {
110 return "[TmfEventField(" + fFieldId + ":" + fValue.toString() + ")]";
111 }
112
113 }
This page took 0.032673 seconds and 6 git commands to generate.