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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Dec 2 10:11:48 GMT 2013


Author: whalley
Date: Mon Dec  2 10:11:48 2013
New Revision: 1718

Log:
Removing debug statements from Bin

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

Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Bin.java
==============================================================================
--- trunk/hepdata-model/src/main/java/cedar/hepdata/model/Bin.java	Wed Nov 27 14:33:31 2013	(r1717)
+++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Bin.java	Mon Dec  2 10:11:48 2013	(r1718)
@@ -134,12 +134,12 @@
         if (_focus != null) return _focus;
 
         // Fall back to calculating the geometric centre
-        log().debug("Asked for focus, but focus is null.");
+//        log().debug("Asked for focus, but focus is null.");
         if (_lowValue != null && _highValue != null) {
-            log().debug("Calculating central value from high and low edges");
+//            log().debug("Calculating central value from high and low edges");
             return (_lowValue + _highValue) / 2.0;
         } else {
-            log().warn("Could neither retrieve nor calculate bin focus.");
+//            log().warn("Could neither retrieve nor calculate bin focus.");
             return null;
         }
     }
@@ -277,12 +277,12 @@
     public Double getWidth() {
         if (_width != null) return _width;
 
-        log().debug("Asked for width, but Width is null.");
+//        log().debug("Asked for width, but Width is null.");
         if (_highValue != null && _lowValue != null) {
-            log().debug("Calculating width from high and low edges");
+//            log().debug("Calculating width from high and low edges");
             return Math.abs(_highValue - _lowValue);
         } else {
-            log().debug("Could neither retrieve nor calculate width");
+//            log().debug("Could neither retrieve nor calculate width");
             return 0.0;
         }
     }

Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Paper.java
==============================================================================
--- trunk/hepdata-model/src/main/java/cedar/hepdata/model/Paper.java	Wed Nov 27 14:33:31 2013	(r1717)
+++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Paper.java	Mon Dec  2 10:11:48 2013	(r1718)
@@ -51,7 +51,7 @@
 
     @Column(name="DOI", unique=false, nullable=true, length=80)
     /** DOI of the paper/journal. */
-    private String _doi = "";
+    private String _doi = null;
 
     @Column(name="DateUpdated", unique=false, nullable=true, length=20)
     /** Date of the last update of the record. eg yyyyMMddhhmmss*/
@@ -64,6 +64,12 @@
     /** The {@link Experiment}(s) that made the measurements in this paper. */
     private SortedSet<Experiment> _experiments = new TreeSet<Experiment>();
 
+    @org.hibernate.annotations.CollectionOfElements
+    @JoinTable(name="Systematics", joinColumns=@JoinColumn(name="PAPER_ID"))
+    @org.hibernate.annotations.Sort(type=org.hibernate.annotations.SortType.NATURAL)
+    /** The {@link Systematic}(s) for the whole  in this paper. */
+    private SortedSet<Systematic> _systematics = new TreeSet<Systematic>();
+
 
     @org.hibernate.annotations.CollectionOfElements
     @JoinTable(name="PaperAuthors", joinColumns=@JoinColumn(name="PAPER_ID"))
@@ -378,6 +384,18 @@
 	    return destring;
     }
 
+    public String getSystematicsString(){
+        StringBuffer s = new StringBuffer();
+	    for(Systematic sys : getSystematics()){
+	        if( sys.getName()!=null){s.append(sys.getName()); }
+            s.append("<br/>");
+	        if( sys.getValue()!=null){s.append(sys.getValue()); }
+	        if( sys.getFolded()!=null){s.append(sys.getFolded()); }
+	        if( sys.getComment()!=null){s.append(sys.getComment()); }
+	    }
+	    return s.toString();
+    }
+
     public String getCommentString(int n){
         StringBuffer s = new StringBuffer();
         String crstring = null;
@@ -764,7 +782,31 @@
     }
 
 
-    ////////////////////////////////////////////////////////////////
+     /** Get the set of systematics to this paper. */
+    public SortedSet<Systematic> getSystematics() {
+        return _systematics;
+    }
+
+    /** Set the set of systematics to this paper. */
+    public Paper setSystematics(SortedSet<Systematic> systematics) {
+        _systematics = systematics;
+        return this;
+    }
+
+    /** Add a systematic to this paper. */
+    public Paper addSystematic(Systematic systematic) {
+        _systematics.add(systematic);
+        return this;
+    }
+
+    /** Remove a systematic. */
+    public Paper removeSystematic(Systematic systematic) {
+        _systematics.remove(systematic);
+        return this;
+    }
+
+
+   ////////////////////////////////////////////////////////////////
 
 
     /** String representation */


More information about the HepData-svn mailing list