KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* TransitionRestrictions.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
16 /**
17 * Represents a WfMC DTD element that has the similar name.
18 * This class is a collection of class <b>TransitionRestrictions</b>
19 * instances.
20 *
21 * @see XML
22 */

23 public class TransitionRestrictions extends XMLCollection {
24
25    public TransitionRestrictions (Activity act) {
26       super(act);
27    }
28
29    // min=0, max=unbounded
30
/**
31    * Generates a new element of the class which instances
32    * are members of collection of this class.
33    *
34    * return The generated instance of class that makes collection.
35    */

36    public XMLElement generateNewElement() {
37       TransitionRestriction tr=new TransitionRestriction();
38       tr.setRequired(true);
39       return tr;
40    }
41
42    /**
43    * Used to create exact copy of instance of this class.
44    * The newly created instance will have all the properties
45    * same as the copied one.
46    *
47    * @return The newly created instance of this class.
48    */

49    public Object JavaDoc clone () {
50       TransitionRestrictions t=(TransitionRestrictions)super.clone();
51       return t;
52    }
53
54    public boolean isEmpty () {
55       if (!super.isEmpty()) {
56          TransitionRestriction tr=(TransitionRestriction)
57                refCollectionElements.get(0);
58          if (tr.isEmpty() && size()==1) {
59             return true;
60          }
61       }
62       return false;
63    }
64
65 }
66
Popular Tags