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 *******************************************************************************/
11 package org
.eclipse
.linuxtools
.ctf
.core
.event
.types
;
13 import java
.nio
.ByteOrder
;
16 public class FloatDeclaration
implements IDeclaration
{
18 // ------------------------------------------------------------------------
20 // ------------------------------------------------------------------------
22 private final int mant
;
23 private final int exp
;
24 private final ByteOrder byteOrder
;
25 private final Encoding encoding
;
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 public FloatDeclaration(int exponent
, int mantissa
, ByteOrder byteOrder
,
35 this.byteOrder
= byteOrder
;
36 this.encoding
= encoding
;
40 // ------------------------------------------------------------------------
41 // Gettters/Setters/Predicates
42 // ------------------------------------------------------------------------
49 public int getMantissa() {
56 public int getExponent() {
61 * @return the byteOrder
63 public ByteOrder
getByteOrder() {
68 * @return the encoding
70 public Encoding
getEncoding() {
74 // ------------------------------------------------------------------------
76 // ------------------------------------------------------------------------
79 public Definition
createDefinition(IDefinitionScope definitionScope
,
81 return new FloatDefinition(this, definitionScope
, fieldName
);
85 public String
toString() {
86 /* Only used for debugging */
87 return "[declaration] float[" + Integer
.toHexString(hashCode()) + ']'; //$NON-NLS-1$