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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Jan 13 15:16:43 GMT 2010


Author: whalley
Date: Wed Jan 13 15:16:43 2010
New Revision: 1340

Log:
again

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

Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Dataset.java
==============================================================================
--- trunk/hepdata-model/src/main/java/cedar/hepdata/model/Dataset.java	Wed Jan 13 15:02:17 2010	(r1339)
+++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Dataset.java	Wed Jan 13 15:16:43 2010	(r1340)
@@ -58,6 +58,13 @@
     @Column(name="DsObservables", length=10000)
     private List<String> _dsobservables = new Vector<String>();
 
+    /** DsPlabs. */
+    @org.hibernate.annotations.CollectionOfElements
+    @JoinTable(name="DsPlabs", joinColumns=@JoinColumn(name="DATASET_ID"))
+    @org.hibernate.annotations.IndexColumn(name="Posn")
+    @Column(name="DsPlabs", length=10000)
+    private List<String> _dsplabs = new Vector<String>();
+
     /** Comments. */
     @org.hibernate.annotations.CollectionOfElements
     @JoinTable(name="DatasetComments", joinColumns=@JoinColumn(name="DATASET_ID"))
@@ -173,6 +180,24 @@
 	    return dsostring;
     }
 
+    public String getDsPlabString(int n){
+        StringBuffer s = new StringBuffer();
+        String dspstring = null;
+	    int nc = 0;
+	    for(String dsp : getDsPlabs()){
+	        nc += 1;
+	        if(nc == n){
+	            if( dsp!=null){
+	                if(n==1) { s.append("PLAB = " + dsp + ";"); }
+		            else     { s.append("PLAB.= " + dsp + ";"); } 
+	                dspstring = s.toString();
+		            break;
+	        }
+	        }
+	    }
+	    return dspstring;
+    }
+
     ////////////////////////////////////////////////////////
 
 
@@ -280,6 +305,27 @@
         return this;
     }
 
+    /** Get DsPlabs. */
+    public List<String> getDsPlabs() {
+        return _dsplabs;
+    }
+    /** Set DsPlabs. */
+    public Dataset setDsPlabs(List<String> dsplabs) {
+        /** @todo Bidirectional? */
+        _dsplabs = dsplabs;
+        return this;
+    }
+    /** Add a DsPlab. */
+    public Dataset addDsPlab(String dsplab) {
+        _dsplabs.add(dsplab);
+        return this;
+    }
+    /** Delete a DsPlab. */
+    public Dataset removeDsPlab(String dsplab) {
+        _dsplabs.remove(dsplab);
+        return this;
+    }
+
 
     /** Get dataset properties. */
     public Set<DatasetProperty> getProperties() {

Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Reference.java
==============================================================================
--- trunk/hepdata-model/src/main/java/cedar/hepdata/model/Reference.java	Wed Jan 13 15:02:17 2010	(r1339)
+++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Reference.java	Wed Jan 13 15:16:43 2010	(r1340)
@@ -1,4 +1,4 @@
-package cedar.hepdata.model;
+ package cedar.hepdata.model;
 
 import java.util.Date;
 import java.util.Set;


More information about the HepData-svn mailing list