[HepData-svn] r1559 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Jul 6 15:16:11 BST 2012


Author: whalley
Date: Fri Jul  6 15:16:11 2012
New Revision: 1559

Log:
getting xbin correct for < > in bdms format output

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/BdmsFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/BdmsFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/BdmsFormatter.java	Fri Jun 29 15:05:48 2012	(r1558)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/BdmsFormatter.java	Fri Jul  6 15:16:11 2012	(r1559)
@@ -177,10 +177,12 @@
                 for (int i=0; i<numpoints; i++){
                     for( int nx=0;  nx<ds.getXAxes().size(); nx++){
                         try{
-                        if(ds.getXAxis(nx+1).getBin(i+1).getRelation() != Relation.EQUALS){ s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getRelation().toString()); }
-                             if(ds.getXAxis(nx+1).getBin(i+1).getFocus() != null){
-                                s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getFocus());
-                                if(ds.getXAxis(nx+1).getBin(i+1).getLowValue() != null 
+                        if(ds.getXAxis(nx+1).getBin(i+1).getRelation() != Relation.EQUALS){ 
+                            s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getRelation().toString()); 
+                        }
+                        if(ds.getXAxis(nx+1).getBin(i+1).getFocus() != null){
+                            s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getFocus());
+                            if(ds.getXAxis(nx+1).getBin(i+1).getLowValue() != null 
                                 && ds.getXAxis(nx+1).getBin(i+1).getHighValue() != null 
                                 && !ds.getXAxis(nx+1).getBin(i+1).getLowValue().equals(ds.getXAxis(nx+1).getBin(i+1).getHighValue())){
                                 s.append(" (BIN=" + ds.getXAxis(nx+1).getBin(i+1).getLowValue() + " TO " + ds.getXAxis(nx+1).getBin(i+1).getHighValue() + ")");                   
@@ -192,9 +194,12 @@
                             else if(ds.getXAxis(nx+1).getBin(i+1).getLowValue() == null && ds.getXAxis(nx+1).getBin(i+1).getHighValue() != null){
                                 s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getHighValue());                   
                             }
+                            else if(ds.getXAxis(nx+1).getBin(i+1).getLowValue() != null && (ds.getXAxis(nx+1).getBin(i+1).getHighValue() == ds.getXAxis(nx+1).getBin(i+1).getLowValue())){
+                                s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getHighValue());                   
+                            }
                             else{
                                 s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getDescription());
-                             }
+                            }
                         }
                         } catch(Exception e){
                            s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getDescription());


More information about the HepData-svn mailing list