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.types; | |
14 | ||
15 | /** | |
16 | * <b><u>StringDeclaration</u></b> | |
17 | */ | |
18 | public class StringDeclaration implements IDeclaration { | |
19 | ||
20 | // ------------------------------------------------------------------------ | |
21 | // Attributes | |
22 | // ------------------------------------------------------------------------ | |
23 | ||
24 | private Encoding encoding = Encoding.UTF8; | |
25 | ||
26 | // ------------------------------------------------------------------------ | |
27 | // Constructors | |
28 | // ------------------------------------------------------------------------ | |
29 | ||
30 | public Encoding getEncoding() { | |
31 | return encoding; | |
32 | } | |
33 | ||
34 | // ------------------------------------------------------------------------ | |
35 | // Constructors | |
36 | // ------------------------------------------------------------------------ | |
37 | ||
38 | public StringDeclaration() { | |
39 | } | |
40 | ||
41 | public StringDeclaration(Encoding encoding) { | |
42 | this.encoding = encoding; | |
43 | } | |
44 | ||
45 | // ------------------------------------------------------------------------ | |
46 | // Getters/Setters/Predicates | |
47 | // ------------------------------------------------------------------------ | |
48 | ||
49 | public void setEncoding(Encoding encoding) { | |
50 | this.encoding = encoding; | |
51 | } | |
52 | ||
53 | // ------------------------------------------------------------------------ | |
54 | // Operations | |
55 | // ------------------------------------------------------------------------ | |
56 | ||
57 | @Override | |
58 | public StringDefinition createDefinition(IDefinitionScope definitionScope, | |
59 | String fieldName) { | |
60 | return new StringDefinition(this, definitionScope, fieldName); | |
61 | } | |
62 | ||
63 | @Override | |
64 | public String toString() { | |
65 | /* Only used for debugging */ | |
66 | return "[declaration] string[" + Integer.toHexString(hashCode()) + ']'; //$NON-NLS-1$ | |
67 | } | |
68 | ||
69 | } |