1 /*******************************************************************************
2 * Copyright (c) 2011, 2013 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 org
.eclipse
.jdt
.annotation
.NonNull
;
15 import org
.eclipse
.linuxtools
.ctf
.core
.event
.scope
.IDefinitionScope
;
18 * A CTF float definition.
20 * The definition of a floating point basic data type. It will take the data
21 * from a trace and store it (and make it fit) as a double.
24 * @author Matthew Khouzam
25 * @author Simon Marchi
27 public final class FloatDefinition
extends Definition
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
32 private final double fValue
;
34 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
42 * the parent declaration
43 * @param definitionScope
51 public FloatDefinition(@NonNull FloatDeclaration declaration
,
52 IDefinitionScope definitionScope
, @NonNull String fieldName
, double value
) {
53 super(declaration
, definitionScope
, fieldName
);
57 // ------------------------------------------------------------------------
58 // Getters/Setters/Predicates
59 // ------------------------------------------------------------------------
62 * The value of a float stored, fit into a double. This should be extended
63 * for exotic floats if this is necessary.
65 * @return the value of the float field fit into a double.
67 public double getValue() {
72 public FloatDeclaration
getDeclaration() {
73 return (FloatDeclaration
) super.getDeclaration();
76 // ------------------------------------------------------------------------
78 // ------------------------------------------------------------------------
81 public String
toString() {
82 return String
.valueOf(fValue
);