1 32 33 package com.jeantessier.dependency; 34 35 import java.util.*; 36 37 public class FeatureNode extends Node { 38 private ClassNode parent; 39 40 public FeatureNode(ClassNode parent, String name, boolean concrete) { 41 super(name, concrete); 42 this.parent = parent; 43 } 44 45 void setConfirmed(boolean confirmed) { 47 super.setConfirmed(confirmed); 48 if (confirmed) { 49 getClassNode().setConfirmed(confirmed); 50 } 51 } 52 53 public ClassNode getClassNode() { 54 return parent; 55 } 56 57 public boolean canAddDependencyTo(Node node) { 58 return super.canAddDependencyTo(node) && getClassNode().canAddDependencyTo(node); 59 } 60 61 public void accept(Visitor visitor) { 62 visitor.visitFeatureNode(this); 63 } 64 65 public void acceptInbound(Visitor visitor) { 66 visitor.visitInboundFeatureNode(this); 67 } 68 69 public void acceptOutbound(Visitor visitor) { 70 visitor.visitOutboundFeatureNode(this); 71 } 72 } 73 | Popular Tags |