Commit | Line | Data |
---|---|---|
866e5b51 FC |
1 | /******************************************************************************* |
2 | * Copyright (c) 2011-2012 Ericsson, Ecole Polytechnique de Montreal and others | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are made | |
5 | * 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: Matthew Khouzam - Initial API and implementation | |
10 | * Contributors: Simon Marchi - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.ctf.core.event; | |
14 | ||
15 | import java.util.HashMap; | |
16 | ||
07002e0a | 17 | /** |
be6df2d8 | 18 | * Clock description used in CTF traces |
07002e0a | 19 | */ |
866e5b51 FC |
20 | public class CTFClock { |
21 | ||
07002e0a MK |
22 | /** |
23 | * Field properties. | |
24 | */ | |
866e5b51 | 25 | final private HashMap<String, Object> properties = new HashMap<String, Object>(); |
07002e0a MK |
26 | /** |
27 | * Field name. | |
28 | */ | |
866e5b51 FC |
29 | private String name; |
30 | ||
be6df2d8 AM |
31 | /** |
32 | * Default constructor | |
33 | */ | |
34 | public CTFClock() {} | |
35 | ||
07002e0a MK |
36 | /** |
37 | * Method addAttribute. | |
38 | * @param key String | |
39 | * @param value Object | |
40 | */ | |
866e5b51 FC |
41 | public void addAttribute(String key, Object value) { |
42 | this.properties.put(key, value); | |
43 | if (key.equals("name")) { //$NON-NLS-1$ | |
44 | this.name = (String) value; | |
45 | } | |
46 | } | |
47 | ||
07002e0a MK |
48 | /** |
49 | * Method getName. | |
50 | * @return String | |
51 | */ | |
866e5b51 FC |
52 | public String getName() { |
53 | return name; | |
54 | } | |
55 | ||
07002e0a MK |
56 | /** |
57 | * Method getProperty. | |
58 | * @param key String | |
59 | * @return Object | |
60 | */ | |
866e5b51 FC |
61 | public Object getProperty(String key) { |
62 | return properties.get(key); | |
63 | } | |
64 | ||
65 | } |