1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
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
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.ctf
.core
.event
.types
;
17 * Parent of sequences and arrays
19 * @author Matthew Khouzam
21 public abstract class CompoundDeclaration
extends Declaration
{
24 * Get the element type
26 * @return the type of element in the array
28 public abstract IDeclaration
getElementType();
31 public long getAlignment() {
32 return getElementType().getAlignment();
36 * Sometimes, strings are encoded as an array of 1-byte integers (each one
37 * being an UTF-8 byte).
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.
42 public boolean isString(){
43 IDeclaration elementType
= getElementType();
44 if (elementType
instanceof IntegerDeclaration
) {
45 IntegerDeclaration elemInt
= (IntegerDeclaration
) elementType
;
46 return elemInt
.isCharacter();