View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package fr.in2p3.jsaga.adaptor.schema.job.emulator.config;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import java.io.IOException;
15  import java.io.Reader;
16  import java.io.Serializable;
17  import java.io.Writer;
18  import org.exolab.castor.types.Duration;
19  import org.exolab.castor.xml.MarshalException;
20  import org.exolab.castor.xml.Marshaller;
21  import org.exolab.castor.xml.Unmarshaller;
22  import org.exolab.castor.xml.ValidationException;
23  import org.xml.sax.ContentHandler;
24  
25  /**
26   * Class DelayType.
27   * 
28   * @version $Revision$ $Date$
29   */
30  public class DelayType implements java.io.Serializable {
31  
32  
33        //--------------------------/
34       //- Class/Member Variables -/
35      //--------------------------/
36  
37      /**
38       * Field _time
39       */
40      private org.exolab.castor.types.Duration _time;
41  
42      /**
43       * Field _percent
44       */
45      private float _percent;
46  
47      /**
48       * keeps track of state for field: _percent
49       */
50      private boolean _has_percent;
51  
52  
53        //----------------/
54       //- Constructors -/
55      //----------------/
56  
57      public DelayType() 
58       {
59          super();
60      } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.config.DelayType()
61  
62  
63        //-----------/
64       //- Methods -/
65      //-----------/
66  
67      /**
68       * Method deletePercent
69       * 
70       */
71      public void deletePercent()
72      {
73          this._has_percent= false;
74      } //-- void deletePercent() 
75  
76      /**
77       * Returns the value of field 'percent'.
78       * 
79       * @return float
80       * @return the value of field 'percent'.
81       */
82      public float getPercent()
83      {
84          return this._percent;
85      } //-- float getPercent() 
86  
87      /**
88       * Returns the value of field 'time'.
89       * 
90       * @return Duration
91       * @return the value of field 'time'.
92       */
93      public org.exolab.castor.types.Duration getTime()
94      {
95          return this._time;
96      } //-- org.exolab.castor.types.Duration getTime() 
97  
98      /**
99       * Method hasPercent
100      * 
101      * 
102      * 
103      * @return boolean
104      */
105     public boolean hasPercent()
106     {
107         return this._has_percent;
108     } //-- boolean hasPercent() 
109 
110     /**
111      * Method isValid
112      * 
113      * 
114      * 
115      * @return boolean
116      */
117     public boolean isValid()
118     {
119         try {
120             validate();
121         }
122         catch (org.exolab.castor.xml.ValidationException vex) {
123             return false;
124         }
125         return true;
126     } //-- boolean isValid() 
127 
128     /**
129      * Method marshal
130      * 
131      * 
132      * 
133      * @param out
134      */
135     public void marshal(java.io.Writer out)
136         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
137     {
138         
139         Marshaller.marshal(this, out);
140     } //-- void marshal(java.io.Writer) 
141 
142     /**
143      * Method marshal
144      * 
145      * 
146      * 
147      * @param handler
148      */
149     public void marshal(org.xml.sax.ContentHandler handler)
150         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
151     {
152         
153         Marshaller.marshal(this, handler);
154     } //-- void marshal(org.xml.sax.ContentHandler) 
155 
156     /**
157      * Sets the value of field 'percent'.
158      * 
159      * @param percent the value of field 'percent'.
160      */
161     public void setPercent(float percent)
162     {
163         this._percent = percent;
164         this._has_percent = true;
165     } //-- void setPercent(float) 
166 
167     /**
168      * Sets the value of field 'time'.
169      * 
170      * @param time the value of field 'time'.
171      */
172     public void setTime(org.exolab.castor.types.Duration time)
173     {
174         this._time = time;
175     } //-- void setTime(org.exolab.castor.types.Duration) 
176 
177     /**
178      * Method unmarshal
179      * 
180      * 
181      * 
182      * @param reader
183      * @return Object
184      */
185     public static java.lang.Object unmarshal(java.io.Reader reader)
186         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
187     {
188         return (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.DelayType) Unmarshaller.unmarshal(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.DelayType.class, reader);
189     } //-- java.lang.Object unmarshal(java.io.Reader) 
190 
191     /**
192      * Method validate
193      * 
194      */
195     public void validate()
196         throws org.exolab.castor.xml.ValidationException
197     {
198         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
199         validator.validate(this);
200     } //-- void validate() 
201 
202 }