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.

Relationship.java 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* *******************************************************************
  2. * Copyright (c) 2003 Contributors.
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * Mik Kersten initial implementation
  11. * Andy Clement Extensions for better IDE representation
  12. * ******************************************************************/
  13. package org.aspectj.asm.internal;
  14. import java.util.List;
  15. import org.aspectj.asm.IRelationship;
  16. //import org.aspectj.asm.IRelationship.Kind;
  17. /**
  18. * @author Mik Kersten
  19. */
  20. public class Relationship implements IRelationship {
  21. private String name;
  22. private Kind kind;
  23. private String sourceHandle;
  24. private List targets;
  25. private boolean hasRuntimeTest;
  26. public Relationship(
  27. String name,
  28. Kind kind,
  29. String sourceHandle,
  30. List targets,
  31. boolean runtimeTest) {
  32. this.name = name;
  33. this.kind = kind;
  34. this.sourceHandle = sourceHandle;
  35. this.targets = targets;
  36. this.hasRuntimeTest = runtimeTest;
  37. }
  38. public String getName() {
  39. return name;
  40. }
  41. public Kind getKind() {
  42. return kind;
  43. }
  44. public String toString() {
  45. return name;
  46. }
  47. public String getSourceHandle() {
  48. return sourceHandle;
  49. }
  50. public List getTargets() {
  51. return targets;
  52. }
  53. public boolean addTarget(String handle) {
  54. if (targets.contains(handle)) return false;
  55. targets.add(handle);
  56. return true;
  57. }
  58. public boolean hasRuntimeTest() {
  59. return hasRuntimeTest;
  60. }
  61. }