ctf: java 8 compliance of javadoc
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / event / types / FloatDeclaration.java
index 89ef7e523b78968c9131f593bb939fbae64b0425..f9ca2ceed58fe9421d3569032f37560d940e3bff 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011-2012 Ericsson, Ecole Polytechnique de Montreal and others
+ * Copyright (c) 2011, 2013 Ericsson, Ecole Polytechnique de Montreal and others
  *
  * All rights reserved. This program and the accompanying materials are made
  * available under the terms of the Eclipse Public License v1.0 which
@@ -13,7 +13,14 @@ package org.eclipse.linuxtools.ctf.core.event.types;
 
 import java.nio.ByteOrder;
 
-
+/**
+ * A CTF float declaration.
+ *
+ * The declaration of a floating point basic data type.
+ *
+ * @version 1.0
+ * @author Matthew Khouzam
+ */
 public class FloatDeclaration implements IDeclaration {
 
     // ------------------------------------------------------------------------
@@ -23,25 +30,35 @@ public class FloatDeclaration implements IDeclaration {
     private final int mant;
     private final int exp;
     private final ByteOrder byteOrder;
-    private final Encoding encoding;
     private final long alignment;
 
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
 
+    /**
+     * Constructor
+     *
+     * @param exponent
+     *            The exponent size in bits
+     * @param mantissa
+     *            The mantissa size in bits (+1 for sign) (see CTF spec)
+     * @param byteOrder
+     *            The byte order
+     * @param alignment
+     *            The alignment. Should be ≥ 1
+     */
     public FloatDeclaration(int exponent, int mantissa, ByteOrder byteOrder,
-            Encoding encoding, long alignment) {
+            long alignment) {
         mant = mantissa;
         exp = exponent;
         this.byteOrder = byteOrder;
-        this.encoding = encoding;
-        this.alignment = alignment;
+        this.alignment = Math.max(alignment, 1);
 
     }
 
     // ------------------------------------------------------------------------
-    // Gettters/Setters/Predicates
+    // Getters/Setters/Predicates
     // ------------------------------------------------------------------------
 
     /**
@@ -65,13 +82,7 @@ public class FloatDeclaration implements IDeclaration {
         return byteOrder;
     }
 
-    /**
-     * @return the encoding
-     */
-    public Encoding getEncoding() {
-        return encoding;
-    }
-
+    @Override
     public long getAlignment() {
         return alignment;
     }
@@ -81,7 +92,7 @@ public class FloatDeclaration implements IDeclaration {
     // ------------------------------------------------------------------------
 
     @Override
-    public Definition createDefinition(IDefinitionScope definitionScope,
+    public FloatDefinition createDefinition(IDefinitionScope definitionScope,
             String fieldName) {
         return new FloatDefinition(this, definitionScope, fieldName);
     }
This page took 0.027193 seconds and 5 git commands to generate.