1 19 20 package org.apache.cayenne.graph; 21 22 import java.util.Collection ; 23 import java.util.Collections ; 24 import java.util.HashMap ; 25 import java.util.Map ; 26 27 39 public class GraphMap implements GraphManager { 40 41 protected Map nodes; 42 43 46 public GraphMap() { 47 this.nodes = new HashMap (); 48 } 49 50 52 55 public Collection registeredNodes() { 56 return Collections.unmodifiableCollection(nodes.values()); 57 } 58 59 public synchronized Object getNode(Object nodeId) { 60 return nodes.get(nodeId); 61 } 62 63 public synchronized void registerNode(Object nodeId, Object nodeObject) { 64 nodes.put(nodeId, nodeObject); 65 } 66 67 public synchronized Object unregisterNode(Object nodeId) { 68 return nodes.remove(nodeId); 69 } 70 71 73 public void arcCreated(Object nodeId, Object targetNodeId, Object arcId) { 74 } 76 77 public void arcDeleted(Object nodeId, Object targetNodeId, Object arcId) { 78 } 80 81 public void nodeCreated(Object nodeId) { 82 } 84 85 public void nodeRemoved(Object nodeId) { 86 } 88 89 public void nodeIdChanged(Object nodeId, Object newId) { 90 } 92 93 public void nodePropertyChanged( 94 Object nodeId, 95 String property, 96 Object oldValue, 97 Object newValue) { 98 } 100 } 101 | Popular Tags |