View Javadoc

1   package org.lcsim.geometry.compact;
2   
3   import org.jdom.Element;
4   
5   /**
6    * The header of the compact detector description.
7    * 
8    * @author tonyj
9    */
10  public class Header
11  {
12      private String name;
13      private String title = "NONE";
14      private String author = "NONE";
15      private String version = "NONE";
16      private String url = "NONE";
17      private String comment = "NONE";
18      private String status = "NONE";
19  
20      protected Header( Element info )
21      {
22          if ( info.getAttributeValue( "name" ) != null )
23          {
24              name = info.getAttributeValue( "name" );
25          }
26          else
27          {
28              throw new RuntimeException( "The <info> element is missing the name field." );
29          }
30  
31          if ( info.getAttribute( "author" ) != null )
32          {
33              author = info.getAttributeValue( "author" );
34          }
35  
36          if ( info.getAttribute( "title" ) != null )
37          {
38              title = info.getAttributeValue( "title" );
39          }
40  
41          if ( info.getAttribute( "version" ) != null )
42          {
43              version = info.getAttributeValue( "version" );
44          }
45  
46          if ( info.getAttribute( "url" ) != null )
47          {
48              url = info.getAttributeValue( "url" );
49          }
50  
51          if ( info.getAttribute( "status" ) != null )
52          {
53              status = info.getAttributeValue( "status" );
54          }
55          
56          if ( info.getChild( "comment" ) != null )
57          {
58              comment = info.getChild( "comment" ).getTextNormalize();
59          }
60  
61      }
62  
63      /**
64       * Get the detector name.
65       * 
66       * @return The name.
67       */
68      public String getDetectorName()
69      {
70          return name;
71      }
72  
73      /**
74       * Get the author of this detector description.
75       * 
76       * @return The author.
77       */
78      public String getAuthor()
79      {
80          return author;
81      }
82  
83      /**
84       * Get the version of the detector.
85       * 
86       * @return The version
87       */
88      public String getVersion()
89      {
90          return version;
91      }
92  
93      /**
94       * The URL providing more information about this detector.
95       * 
96       * @return The URL.
97       */
98      public String getURL()
99      {
100         return url;
101     }
102 
103     /**
104      * A comment describing the detector
105      * 
106      * @return The comment.
107      */
108     public String getComment()
109     {
110         return comment;
111     }
112 
113     /**
114      * Get the title of this detector.
115      * 
116      * @return The title.
117      */
118     public String getTitle()
119     {
120         return title;
121     }
122 
123     /**
124      * Get the production status of this detector.
125      * 
126      * @return The status description.
127      */
128     public String getStatus()
129     {
130         return status;
131     }
132 }