6 * represents a set in the model space
9 public class RelationDescriptor extends Descriptor {
14 public static String prefix="";
15 public static final Usage NONE = new Usage("NONE");
16 public static final Usage IMAGE = new Usage("IMAGE");
17 public static final Usage INVIMAGE = new Usage("INVIMAGE");
18 public static final Usage BOTH = new Usage("BOTH");
20 public static class Usage {
22 private Usage(String name) { this.name = name; }
23 public String toString() { return name; }
28 public RelationDescriptor(String name) {
35 public boolean isStatic() {
39 public void isStatic(boolean newvalue) {
43 public void setDomain(SetDescriptor td) {
47 public SetDescriptor getDomain() {
51 public void setRange(SetDescriptor td) {
55 public SetDescriptor getRange() {
59 public void addUsage(Usage newusage) {
60 if (newusage == null || newusage == NONE || newusage == BOTH) {
61 throw new IllegalArgumentException();
64 Usage oldusage = usage;
68 } else if (usage == IMAGE && newusage == INVIMAGE) {
70 } else if (usage == INVIMAGE && newusage == IMAGE) {
76 //System.out.println(getSymbol() + " usage: " + oldusage + " + " + newusage + " => " + usage);
79 public boolean testUsage(Usage testusage) {
80 return (usage == BOTH) || (testusage == usage);
83 public String getSafeSymbol() {
84 return prefix+safename;
87 public String getJustSafeSymbol() {