KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > xml > elements > SimulationInformation


1 /* SimulationInformation.java
2  *
3  * Authors:
4  * Stefanovic Nenad chupo@iis.ns.ac.yu
5  * Bojanic Sasa sasaboy@neobee.net
6  * Puskas Vladimir vpuskas@eunet.yu
7  * Pilipovic Goran zboniek@uns.ac.yu
8  *
9  */

10
11 package org.enhydra.jawe.xml.elements;
12
13 import org.enhydra.jawe.xml.*;
14 import org.enhydra.jawe.xml.panels.*;
15 import org.w3c.dom.*;
16
17 /**
18 * Represents a WfMC DTD element that has the similar name.
19 *
20 * @see XML
21 */

22 public class SimulationInformation extends XMLComplexElement {
23    private Cost refCost=new Cost();
24    private TimeEstimation refTimeEstimation=new TimeEstimation();
25
26    private XMLAttribute attrInstantiation=new XMLAttribute("Instantiation",
27       new String JavaDoc[] {
28          "",
29          "ONCE",
30          "MULTIPLE"
31       },0);
32
33    /**
34    * Creates a new instance of the class.
35    */

36    public SimulationInformation () {
37       super();
38
39       fillStructure();
40    }
41
42    /**
43    * Defines the super-class method. Read the explanation for
44    * this method within XMLComplexElement class.
45    */

46    protected void fillStructure () {
47       complexStructure.add(attrInstantiation);
48       attributes.add(attrInstantiation);
49       refCost.setRequired(true);
50       complexStructure.add(refCost);
51       refTimeEstimation.setRequired(true);
52       complexStructure.add(refTimeEstimation);
53    }
54
55    public void fromXML(Node node) {
56       attrInstantiation.setValue("");
57       super.fromXML(node);
58    }
59
60    /**
61    * Used to create exact copy of instance of this class.
62    * The newly created instance will have all the properties
63    * same as the copied one.
64    *
65    * @return The newly created instance of this class.
66    */

67    public Object JavaDoc clone () {
68       SimulationInformation s=(SimulationInformation)super.clone();
69
70       s.attrInstantiation=(XMLAttribute)this.attrInstantiation.clone();
71       s.refCost=(Cost)this.refCost.clone();
72       s.refTimeEstimation=(TimeEstimation)this.refTimeEstimation.clone();
73
74       s.fillStructure();
75
76       return s;
77    }
78
79
80 }
81
Popular Tags