Remove all existing @since annotations
[deliverable/tracecompass.git] / org.eclipse.tracecompass.ctf.core / src / org / eclipse / tracecompass / ctf / core / event / types / CompoundDeclaration.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
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:
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.ctf.core.event.types;
14
15
16 /**
17 * Parent of sequences and arrays
18 *
19 * @author Matthew Khouzam
20 */
21 public abstract class CompoundDeclaration extends Declaration {
22
23 /**
24 * Get the element type
25 *
26 * @return the type of element in the array
27 */
28 public abstract IDeclaration getElementType();
29
30 @Override
31 public long getAlignment() {
32 return getElementType().getAlignment();
33 }
34
35 /**
36 * Sometimes, strings are encoded as an array of 1-byte integers (each one
37 * being an UTF-8 byte).
38 *
39 * @return true if this array is in fact an UTF-8 string. false if it's a
40 * "normal" array of generic Definition's.
41 */
42 public boolean isString(){
43 IDeclaration elementType = getElementType();
44 if (elementType instanceof IntegerDeclaration) {
45 IntegerDeclaration elemInt = (IntegerDeclaration) elementType;
46 return elemInt.isCharacter();
47 }
48 return false;
49 }
50
51 }
This page took 0.031506 seconds and 5 git commands to generate.