4 * represents a set in the model space
10 public class SetDescriptor extends Descriptor {
16 public SetDescriptor(String name) {
18 subsets = new Vector();
22 public static Set expand(Set descriptors) {
23 HashSet expanded = new HashSet();
24 Iterator d = descriptors.iterator();
27 Descriptor descriptor = (Descriptor) d.next();
29 if (descriptor instanceof SetDescriptor) {
30 expanded.addAll(((SetDescriptor) descriptor).allSubsets());
32 expanded.add(descriptor); /* Still need the descriptor */
35 expanded.addAll(descriptors);
39 public boolean isPartition() {
43 public void isPartition(boolean newvalue) {
47 public void setType(TypeDescriptor td) {
51 public TypeDescriptor getType() {
55 public void addSubset(SetDescriptor sd) {
56 subsets.addElement(sd);
59 public Vector getSubsets() {
63 public Iterator subsets() {
64 return subsets.iterator();
67 public boolean isSubset(SetDescriptor sd) {
72 for (int i = 0; i < subsets.size(); i++) {
73 SetDescriptor subset = (SetDescriptor) subsets.elementAt(i);
74 if (subset.isSubset(sd)) {
82 public Set allSubsets() {
83 Set v = new HashSet();
86 for (int i = 0; i < subsets.size(); i++) {
87 SetDescriptor subset = (SetDescriptor) subsets.elementAt(i);
88 v.addAll(subset.allSubsets());