View Javadoc

1   /*
2    * Limit.java
3    *
4    * Created on October 26, 2005, 5:38 PM
5    *
6    * To change this template, choose Tools | Options and locate the template under
7    * the Source Creation and Management node. Right-click the template and choose
8    * Open. You can then make changes to the template in the Source Editor.
9    */
10  
11  package org.lcsim.geometry.compact.converter.lcdd.util;
12  
13  import java.util.ArrayList;
14  import java.util.List;
15  import org.jdom.Element;
16  
17  /**
18   *
19   * @author jeremym
20   */
21  public class Limit extends Element
22  {   
23      /** Creates a new instance of Limit */
24      public Limit(String name)
25      {
26          super("limit");    
27          setAttribute("name", name);
28          setUnit("mm");
29          setParticles("*");       
30      }
31   
32      /** 
33       * Set comma delimited list of particles to which limit applies.  These are
34       * the Geant4 particle names.  "*" for all particles.
35       */
36      public void setParticles(String particleNames)
37      {
38          setAttribute("particles", particleNames);
39      }
40      
41      public void setValue(double value)
42      {
43          setAttribute("value", String.valueOf(value));
44      }
45      
46      public void setUnit(String unit)
47      {
48          setAttribute("unit", unit);
49      }
50  }