1 /*******************************************************************************
2 * Copyright (c) 2009 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.event
;
16 * <b><u>TmfEventField</u></b>
18 * A basic event field.
20 * TODO: Add support for field hierarchy.
22 public class TmfEventField
{
24 // ------------------------------------------------------------------------
26 // ------------------------------------------------------------------------
28 private final TmfEventContent fParent
;
29 private final String fFieldId
;
30 private Object fValue
;
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
36 @SuppressWarnings("unused")
37 private TmfEventField() {
38 throw new AssertionError();
46 public TmfEventField(TmfEventContent parent
, String id
, Object value
) {
48 throw new IllegalArgumentException();
58 public TmfEventField(TmfEventField other
) {
60 throw new IllegalArgumentException();
61 fParent
= other
.fParent
;
62 fFieldId
= other
.fFieldId
;
63 fValue
= other
.fValue
;
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
73 public TmfEventContent
getParent() {
80 public String
getId() {
87 public Object
getValue() {
92 * @param value new field value
94 protected void setValue(Object value
) {
98 // ------------------------------------------------------------------------
100 // ------------------------------------------------------------------------
103 public int hashCode() {
105 result
= 37 * result
+ fFieldId
.hashCode();
106 result
= 37 * result
+ fValue
.hashCode();
111 public boolean equals(Object other
) {
112 if (!(other
instanceof TmfEventField
))
114 TmfEventField o
= (TmfEventField
) other
;
115 return fParent
.equals(o
.fParent
) && fFieldId
.equals(o
.fFieldId
) && fValue
.equals(o
.fValue
);
119 public String
toString() {
120 return "[TmfEventField(" + fFieldId
+ ":" + fValue
.toString() + ")]";
This page took 0.03304 seconds and 5 git commands to generate.