You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Case2.java 1011B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import java.util.*;
  2. import java.lang.annotation.*;
  3. import java.lang.ref.*;
  4. class Product {}
  5. class ProductType{}
  6. class Branch {}
  7. class Revision {}
  8. interface AssociationSource<T> {
  9. Link<T> getTarget();
  10. void setTarget(Link<T> _target);
  11. }
  12. aspect ExtendProduct {
  13. Link<T> AssociationSource<T>._target = null;
  14. public Link<T> AssociationSource<T>.getTarget() {
  15. return _target;
  16. }
  17. public void AssociationSource<T>.setTarget(Link<T> _target) {
  18. this._target = _target;
  19. }
  20. declare parents : ProductType implements AssociationSource<Product>;
  21. /*
  22. declare parents : Product implements AssociationSource<Branch>;
  23. declare parents : Branch implements AssociationSource<Revision>;
  24. */
  25. }
  26. class Link<T> {//extends SoftReference {
  27. /* @SuppressWarnings("unchecked")
  28. Link(List<T> endPoints) {
  29. super(endPoints);
  30. }
  31. @SuppressWarnings("unchecked")
  32. public List<T> getEndPoints() {
  33. return (List<T>)get();
  34. }
  35. */
  36. }