Interaction031.java

Package: coupling/interaction/
File: Interaction031.java

  1. package coupling.interaction;
  2.  
  3. /**
  4.  * An Interaction031 is an Interaction030 with a weight.
  5.  */
  6. public class Interaction031 extends Interaction030 {
  7.  
  8. private int weight = 0;
  9.  
  10. public Interaction031(String label){
  11. super(label);
  12. }
  13.  
  14. @Override
  15. public Interaction031 getPreInteraction() {
  16. return (Interaction031)super.getPreInteraction();
  17. }
  18.  
  19. @Override
  20. public Interaction031 getPostInteraction() {
  21. return (Interaction031)super.getPostInteraction();
  22. }
  23.  
  24. public int getWeight() {
  25. return this.weight;
  26. }
  27.  
  28. public void incrementWeight() {
  29. this.weight++;
  30. }
  31.  
  32. @Override
  33. public String toString(){
  34. return this.getLabel() + " valence " + this.getValence() + " weight " + this.weight;
  35. }
  36.  
  37. }
  38.  

See public discussions about this page or start a new discussion by clicking on the Google+ Share button. Please type the #IDEALMOOCInteraction031 hashtag in your post: