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 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.ctf
.core
.event
.types
;
14 import java
.nio
.ByteOrder
;
17 public class FloatDeclaration
implements IDeclaration
{
19 // ------------------------------------------------------------------------
21 // ------------------------------------------------------------------------
23 private final int mant
;
24 private final int exp
;
25 private final ByteOrder byteOrder
;
26 private final Encoding encoding
;
27 private final long alignment
;
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
33 public FloatDeclaration(int exponent
, int mantissa
, ByteOrder byteOrder
,
34 Encoding encoding
, long alignment
) {
37 this.byteOrder
= byteOrder
;
38 this.encoding
= encoding
;
39 this.alignment
= alignment
;
43 // ------------------------------------------------------------------------
44 // Gettters/Setters/Predicates
45 // ------------------------------------------------------------------------
50 public int getMantissa() {
57 public int getExponent() {
62 * @return the byteOrder
64 public ByteOrder
getByteOrder() {
69 * @return the encoding
71 public Encoding
getEncoding() {
75 public long getAlignment() {
79 // ------------------------------------------------------------------------
81 // ------------------------------------------------------------------------
84 public Definition
createDefinition(IDefinitionScope definitionScope
,
86 return new FloatDefinition(this, definitionScope
, fieldName
);
90 public String
toString() {
91 /* Only used for debugging */
92 return "[declaration] float[" + Integer
.toHexString(hashCode()) + ']'; //$NON-NLS-1$