1 18 19 package org.objectweb.jac.ide; 20 21 import org.objectweb.jac.util.Strings; 22 23 24 public class Role extends ModelElement implements Typed { 25 26 public Role(Link link) { 27 this.link = link; 28 } 29 30 public Role() { 31 } 32 33 34 Link link; 35 public Link getLink() { 36 return link; 37 } 38 39 public void setLink(Link link) { 40 this.link = link; 41 } 42 43 44 ModelElement end; 45 49 public ModelElement getEnd() { 50 return end; 51 } 52 55 public void setEnd(ModelElement end) { 56 this.end = end; 57 } 58 59 ModelElement start; 60 64 public ModelElement getStart() { 65 return start; 66 } 67 70 public void setStart(ModelElement start) { 71 this.start = start; 72 } 73 74 public Role oppositeRole() { 75 if (link.getStartRole()==this) 76 return link.getEndRole(); 77 else 78 return link.getStartRole(); 79 } 80 81 public boolean isStartRole() { 82 return link.getStartRole()==this; 83 } 84 85 public boolean isEndRole() { 86 return link.getEndRole()==this; 87 } 88 89 public String getGenerationName() { 90 return Strings.toUSAscii(getName()); 91 } 92 93 public String getGenerationFullName() { 94 return Strings.toUSAscii(getFullName()); 95 } 96 97 } 98 | Popular Tags |