01: package org.enhydra.shark.xpdl.elements;
02:
03: import org.enhydra.shark.xpdl.XMLAttribute;
04: import org.enhydra.shark.xpdl.XMLComplexElement;
05: import org.enhydra.shark.xpdl.XPDLConstants;
06:
07: /**
08: * Represents coresponding element from XPDL schema.
09: *
10: * @author Sasa Bojanic
11: */
12: public class SimulationInformation extends XMLComplexElement {
13:
14: public SimulationInformation(Activity parent) {
15: super (parent, false);
16: }
17:
18: protected void fillStructure() {
19: XMLAttribute attrInstantiation = new XMLAttribute(this ,
20: "Instantiation", false, new String[] {
21: XPDLConstants.INSTANTIATION_NONE,
22: XPDLConstants.INSTANTIATION_ONCE,
23: XPDLConstants.INSTANTIATION_MULTIPLE }, 0);
24: Cost refCost = new Cost(this );
25: TimeEstimation refTimeEstimation = new TimeEstimation(this );
26:
27: add(attrInstantiation);
28: add(refCost);
29: add(refTimeEstimation);
30: }
31:
32: public XMLAttribute getInstantiationAttribute() {
33: return (XMLAttribute) get("Instantiation");
34: }
35:
36: public String getInstantiation() {
37: return getInstantiationAttribute().toValue();
38: }
39:
40: public void setInstantiationNONE() {
41: getInstantiationAttribute().setValue(
42: XPDLConstants.INSTANTIATION_NONE);
43: }
44:
45: public void setInstantiationONCE() {
46: getInstantiationAttribute().setValue(
47: XPDLConstants.INSTANTIATION_ONCE);
48: }
49:
50: public void setInstantiationMULTIPLE() {
51: getInstantiationAttribute().setValue(
52: XPDLConstants.INSTANTIATION_MULTIPLE);
53: }
54:
55: public String getCost() {
56: return get("Cost").toValue();
57: }
58:
59: public void setCost(String cost) {
60: set("Cost", cost);
61: }
62:
63: public TimeEstimation getTimeEstimation() {
64: return (TimeEstimation) get("TimeEstimation");
65: }
66: }
|