[HepData-svn] r1449 - trunk/hepdata-model/src/main/java/cedar/hepdata/model

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Mar 28 15:27:57 BST 2011


Author: whalley
Date: Mon Mar 28 15:27:57 2011
New Revision: 1449

Log:
adding number of decimal points to display to focus etc...

Modified:
   trunk/hepdata-model/src/main/java/cedar/hepdata/model/Bin.java

Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Bin.java
==============================================================================
--- trunk/hepdata-model/src/main/java/cedar/hepdata/model/Bin.java	Mon Mar 28 15:26:15 2011	(r1448)
+++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Bin.java	Mon Mar 28 15:27:57 2011	(r1449)
@@ -25,6 +25,10 @@
     @Column(name="Focus", nullable=true)
     private Double _focus = null;
 
+    /** The number of decimal places for display */
+    @Column(name="FocusLength", nullable=true)
+    private Integer _focuslength;
+
     /** Bin width (optional: should be paired with CentralValue) */
     /// @todo Sort out this ambiguous mess!
     @Column(name="Width", nullable=true)
@@ -34,10 +38,18 @@
     @Column(name="LowValue", nullable=true)
     private Double _lowValue = null;
 
+    /** The number of decimal places for display */
+    @Column(name="LowValueLength", nullable=true)
+    private Integer _lowvaluelength;
+
     /** High edge of the bin (optional: must be paired with LowValue) */
     @Column(name="HighValue", nullable=true)
     private Double _highValue = null;
 
+    /** The number of decimal places for display */
+    @Column(name="HighValueLength", nullable=true)
+    private Integer _highvaluelength;
+
      /**String Description - only used if none numerical value */
     @Column(name="Description", nullable=true)
     private String _description = null;
@@ -137,6 +149,15 @@
         _focus = focus;
         return this;
     }
+    /** Get the bin focuslength. */
+    public Integer getFocusLength() {
+        return _focuslength;
+    }
+    /** Set the bin focuslength. */
+    public Bin setFocusLength(Integer focuslength) {
+        _focuslength = focuslength;
+        return this;
+    }
 
 
     /** Get bin-edge {@link Relation}. The relation can give different meanings
@@ -177,6 +198,15 @@
         _lowValue = lowValue;
         return this;
     }
+    /** Get the bin lowvaluelength. */
+    public Integer getLowValueLength() {
+        return _lowvaluelength;
+    }
+    /** Set the bin lowvaluelength. */
+    public Bin setLowValueLength(Integer lowvaluelength) {
+        _lowvaluelength = lowvaluelength;
+        return this;
+    }
 
 
     /** Get high edge value */
@@ -184,6 +214,9 @@
         if (_highValue != null) return _highValue;
         if (getFocus() != null && getWidth() != null) {
             return getFocus() + getWidth()/2.0;
+        }
+        if(getFocus() == null && _lowValue !=null)  { 
+           return _lowValue; 
         } else {
             return getFocus();
         }
@@ -193,6 +226,15 @@
         _highValue = highValue;
         return this;
     }
+    /** Get the bin highvaluelength. */
+    public Integer getHighValueLength() {
+        return _highvaluelength;
+    }
+    /** Set the bin highvaluelength. */
+    public Bin setHighValueLength(Integer highvaluelength) {
+        _highvaluelength = highvaluelength;
+        return this;
+    }
 
 
     /** Get shift from the focus to the low edge. */


More information about the HepData-svn mailing list