1 19 20 package org.apache.cayenne.graph; 21 22 26 public class ArcDeleteOperation extends NodeDiff { 27 28 protected Object targetNodeId; 29 protected Object arcId; 30 31 public ArcDeleteOperation(Object nodeId, Object targetNodeId, Object arcId) { 32 super(nodeId); 33 this.targetNodeId = targetNodeId; 34 this.arcId = arcId; 35 } 36 37 public ArcDeleteOperation(Object nodeId, Object targetNodeId, Object arcId, int diffId) { 38 super(nodeId, diffId); 39 this.targetNodeId = targetNodeId; 40 this.arcId = arcId; 41 } 42 43 public void apply(GraphChangeHandler tracker) { 44 tracker.arcDeleted(nodeId, targetNodeId, arcId); 45 } 46 47 public void undo(GraphChangeHandler tracker) { 48 tracker.arcCreated(nodeId, targetNodeId, arcId); 49 } 50 51 public Object getArcId() { 52 return arcId; 53 } 54 55 public Object getTargetNodeId() { 56 return targetNodeId; 57 } 58 } 59 | Popular Tags |