1 /*******************************************************************************
2 * Copyright (c) 2011-2012 Ericsson, Ecole Polytechnique de Montreal and others
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
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 * Contributors: Simon Marchi - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.ctf
.core
.event
.types
;
15 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFReaderException
;
18 * <b><u>SequenceDeclaration</u></b>
20 public class SequenceDeclaration
implements IDeclaration
{
22 // ------------------------------------------------------------------------
24 // ------------------------------------------------------------------------
26 private final IDeclaration elemType
;
27 private final String lengthName
;
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
33 public SequenceDeclaration(String lengthName
, IDeclaration elemType
) {
34 this.elemType
= elemType
;
35 this.lengthName
= lengthName
;
38 // ------------------------------------------------------------------------
39 // Gettters/Setters/Predicates
40 // ------------------------------------------------------------------------
42 public IDeclaration
getElementType() {
46 public String
getLengthName() {
51 public long getAlignment() {
52 return getElementType().getAlignment();
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 public SequenceDefinition
createDefinition(
60 IDefinitionScope definitionScope
, String fieldName
) {
61 SequenceDefinition ret
= null;
63 ret
= new SequenceDefinition(this, definitionScope
, fieldName
);
64 } catch (CTFReaderException e
) {
65 // Temporarily catch this here, eventually this should be thrown
73 public String
toString() {
74 /* Only used for debugging */
75 return "[declaration] sequence[" + Integer
.toHexString(hashCode()) + ']'; //$NON-NLS-1$