Commit in GeomConverter/src/org/lcsim/detector on MAIN
DetectorElement.java+17-31.14 -> 1.15
IDetectorElement.java+5-31.10 -> 1.11
IReadout.java+4-41.2 -> 1.3
Readout.java+16-91.1 -> 1.2
+42-19
4 modified files
JM: Support for readout of a DetectorElement.

GeomConverter/src/org/lcsim/detector
DetectorElement.java 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- DetectorElement.java	27 Apr 2007 01:07:48 -0000	1.14
+++ DetectorElement.java	27 Apr 2007 12:33:39 -0000	1.15
@@ -271,15 +271,29 @@
         return srch;                       
     }    
     
-    public IReadout getReadout()
+    public <T> IReadout<T> getReadout()
     {
+	if ( readout == null ) 
+	{
+	    readout = new Readout<T>();
+	}
         return readout;
     }    
     
-    public void setReadout(IReadout readout)
+    public <T> void setReadout(IReadout<T> readout)
     {
         this.readout = readout;        
     }
+
+    public <T> void createReadout( Class<T> klass )
+    {
+	this.readout = new Readout<T>();
+    }
+
+    public boolean hasReadout()
+    {
+	return this.readout != null;
+    }
     
     public IParameters getParameters()
     {
@@ -304,4 +318,4 @@
          
         return parents;        
     }
-}
\ No newline at end of file
+}

GeomConverter/src/org/lcsim/detector
IDetectorElement.java 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- IDetectorElement.java	27 Apr 2007 01:07:48 -0000	1.10
+++ IDetectorElement.java	27 Apr 2007 12:33:39 -0000	1.11
@@ -11,7 +11,7 @@
  * 
  * @author Tim Nelson <[log in to unmask]>
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: IDetectorElement.java,v 1.10 2007/04/27 01:07:48 jeremy Exp $
+ * @version $Id: IDetectorElement.java,v 1.11 2007/04/27 12:33:39 jeremy Exp $
  */
 public interface IDetectorElement 
 extends IIdentifiable, INamed
@@ -106,7 +106,9 @@
      * @return Associated IReadout object or <code>null</code> if
      *         no IReadout has been assigned to this DetectorElement.
      */
-    public IReadout getReadout();
+    public <T> IReadout<T> getReadout();
+
+    public boolean hasReadout();
     
     /**
      * The named parameters associated with this DetectorElement.
@@ -123,4 +125,4 @@
      * @return
      */
     public IDetectorElementContainer getAncestry();
-}
\ No newline at end of file
+}

GeomConverter/src/org/lcsim/detector
IReadout.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- IReadout.java	27 Apr 2007 01:07:48 -0000	1.2
+++ IReadout.java	27 Apr 2007 12:33:39 -0000	1.3
@@ -2,8 +2,8 @@
 
 import java.util.List;
 
-public interface IReadout
+public interface IReadout<T>
 {
-	public String getName();
-    public List<?> getHits();
-}
\ No newline at end of file
+    public List<T> getHits();
+    public void clear();
+}

GeomConverter/src/org/lcsim/detector
Readout.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Readout.java	27 Apr 2007 01:07:48 -0000	1.1
+++ Readout.java	27 Apr 2007 12:33:39 -0000	1.2
@@ -2,19 +2,21 @@
 import java.util.ArrayList;
 import java.util.List;
 
-public class Readout<T> 
+/**
+ * Simple readout implementation that is able
+ * to store a list of hits of one type.
+ */
+public class Readout<T>
 implements IReadout
 {
-    String name;
     List<T> hits;
     
-    public Readout(String name)
+    public Readout()
     {
-        this.name = name;
         this.hits = new ArrayList<T>();
     }
     
-    public Readout(String name, List<T> hits)
+    public Readout(List<T> hits)
     {
         this.hits = hits;
     }
@@ -29,8 +31,13 @@
         hits.add(hit);
     }
 
-    public String getName()
+    public void setHits(List<T> hits)
     {
-        return name;
-    }     
-}
\ No newline at end of file
+	this.hits = hits;
+    }
+
+    public void clear()
+    {
+	hits.clear(); 
+    }
+}
CVSspam 0.2.8