Improve javadoc for ctfAdapter in Tmf.Core
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / event / types / ArrayDeclaration.java
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>ArrayDeclaration</u></b>
17 */
18 public class ArrayDeclaration implements IDeclaration {
19
20 // ------------------------------------------------------------------------
21 // Attributes
22 // ------------------------------------------------------------------------
23
24 private final int length;
25 private final IDeclaration elemType;
26
27 // ------------------------------------------------------------------------
28 // Constructors
29 // ------------------------------------------------------------------------
30
31 /**
32 * Constructor
33 * @param length how many elements in the array
34 * @param elemType what type of element is in the array
35 */
36 public ArrayDeclaration(int length, IDeclaration elemType) {
37 this.length = length;
38 this.elemType = elemType;
39 }
40
41 // ------------------------------------------------------------------------
42 // Getters/Setters/Predicates
43 // ------------------------------------------------------------------------
44
45 /**
46 *
47 * @return the type of element in the array
48 */
49 public IDeclaration getElementType() {
50 return elemType;
51 }
52
53 /**
54 *
55 * @return how many elements in the array
56 */
57 public int getLength() {
58 return length;
59 }
60
61 @Override
62 public long getAlignment() {
63 long retVal = this.getElementType().getAlignment();
64 return retVal;
65 }
66 // ------------------------------------------------------------------------
67 // Operations
68 // ------------------------------------------------------------------------
69
70 @Override
71 public ArrayDefinition createDefinition(IDefinitionScope definitionScope,
72 String fieldName) {
73 return new ArrayDefinition(this, definitionScope, fieldName);
74 }
75
76 @Override
77 public String toString() {
78 /* Only used for debugging */
79 return "[declaration] array[" + Integer.toHexString(hashCode()) + ']'; //$NON-NLS-1$
80 }
81
82 }
This page took 0.032482 seconds and 6 git commands to generate.