Refactor TmfEventContent and adjust other model types
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / stubs / org / eclipse / linuxtools / tmf / stubs / event / TmfEventContentStub.java
CommitLineData
d18dd09b
ASL
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
6c13869b
FC
13package org.eclipse.linuxtools.tmf.stubs.event;
14
15import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
16import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
5d3e8747 17import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
6c13869b 18import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
d18dd09b
ASL
19
20/**
21 * <b><u>TmfEventContentStub</u></b>
22 * <p>
23 * TODO: Implement me. Please.
24 */
3b38ea61 25@SuppressWarnings("nls")
d18dd09b
ASL
26public class TmfEventContentStub extends TmfEventContent {
27
5d3e8747 28 public TmfEventContentStub(TmfEvent parent, String content) {
d18dd09b
ASL
29 super(parent, content);
30 }
31
32 public TmfEventContentStub(TmfEventContentStub other) {
33 super(other);
34 }
35
36 @Override
37 protected void parseContent() {
5d3e8747 38 Object value1 = new Integer(1);
39 Object value2 = new Integer(-10);
40 Object value3 = new Boolean(true);
41 Object value4 = new String("some string");
42 Object value5 = new TmfTimestamp(1, (byte) 2, 3);
43
44 TmfEventField field1 = new TmfEventField(this, "field1", value1);
45 TmfEventField field2 = new TmfEventField(this, "field2", value2);
46 TmfEventField field3 = new TmfEventField(this, "field3", value3);
47 TmfEventField field4 = new TmfEventField(this, "field4", value4);
48 TmfEventField field5 = new TmfEventField(this, "field5", value5);
49
50 fFields = new TmfEventField[] { field1, field2, field3, field4, field5 };
d18dd09b
ASL
51 }
52
53 @Override
54 public TmfEventContent clone() {
55 TmfEventContentStub content = new TmfEventContentStub(this);
56 content.fRawContent = "Some content";
57 content.fFields = null;
58 return content;
59 }
60
cbd4ad82
FC
61// @Override
62// public String toString() {
63// Object[] fields = getFields();
64// StringBuilder result = new StringBuilder("[TmfEventContent(");
65// for (int i = 0; i < fields.length; i++) {
66// if (i > 0) result.append(",");
67// result.append(fields[i]);
68// }
69// result.append(")]");
70// return result.toString();
71// }
d18dd09b 72}
This page took 0.059763 seconds and 5 git commands to generate.