Commit | Line | Data |
---|---|---|
a0a88f65 | 1 | /******************************************************************************* |
c8422608 | 2 | * Copyright (c) 2010, 2013 Ericsson |
a0a88f65 AM |
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 | * Patrick Tassé - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
be222f56 PT |
13 | package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom; |
14 | ||
15 | import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; | |
16 | import org.eclipse.linuxtools.tmf.core.event.TmfEventField; | |
17 | ||
a0a88f65 AM |
18 | /** |
19 | * Event content for custom text parsers | |
20 | * | |
21 | * @author Patrick Tassé | |
22 | */ | |
be222f56 PT |
23 | public class CustomEventContent extends TmfEventField { |
24 | ||
a0a88f65 AM |
25 | /** |
26 | * Constructor. | |
27 | * | |
28 | * @param parent | |
29 | * Parent event | |
30 | * @param content | |
31 | * Event content | |
32 | */ | |
be222f56 PT |
33 | public CustomEventContent(CustomEvent parent, StringBuffer content) { |
34 | super(ITmfEventField.ROOT_FIELD_ID, content); | |
35 | } | |
36 | ||
80349bf7 AM |
37 | /** |
38 | * Create a new event field with sub-fields. | |
39 | * | |
40 | * @param name | |
41 | * Field name | |
42 | * @param content | |
43 | * Event content | |
44 | * @param fields | |
45 | * The array of sub-fields | |
46 | */ | |
47 | public CustomEventContent(String name, Object content, ITmfEventField[] fields) { | |
48 | super(name, content, fields); | |
49 | } | |
50 | ||
be222f56 PT |
51 | @Override |
52 | public int hashCode() { | |
53 | return super.hashCode(); | |
54 | } | |
55 | ||
be222f56 PT |
56 | @Override |
57 | public boolean equals(Object obj) { | |
58 | if (this == obj) { | |
59 | return true; | |
60 | } | |
61 | if (!super.equals(obj)) { | |
62 | return false; | |
63 | } | |
64 | if (!(obj instanceof CustomEventContent)) { | |
65 | return false; | |
66 | } | |
67 | return true; | |
68 | } | |
be222f56 | 69 | } |