1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 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
.tracecompass
.ctf
.core
.event
.types
;
14 import org
.eclipse
.jdt
.annotation
.NonNull
;
15 import org
.eclipse
.tracecompass
.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
50 public FloatDefinition(@NonNull FloatDeclaration declaration
,
51 IDefinitionScope definitionScope
, @NonNull String fieldName
, double value
) {
52 super(declaration
, definitionScope
, fieldName
);
56 // ------------------------------------------------------------------------
57 // Getters/Setters/Predicates
58 // ------------------------------------------------------------------------
61 * The value of a float stored, fit into a double. This should be extended
62 * for exotic floats if this is necessary.
64 * @return the value of the float field fit into a double.
66 public double getValue() {
71 public FloatDeclaration
getDeclaration() {
72 return (FloatDeclaration
) super.getDeclaration();
75 // ------------------------------------------------------------------------
77 // ------------------------------------------------------------------------
80 public String
toString() {
81 return String
.valueOf(fValue
);