Class GraphMap
java.lang.Object
org.apache.cayenne.graph.GraphMap
- All Implemented Interfaces:
GraphChangeHandler, GraphManager
A base implementation of GraphManager that stores graph nodes keyed by their ids.
Tracking Object Changes
Registered objects may choose to notify GraphMap of their changes by using callback methods defined in GraphChangeHandler interface. GraphMap itself implements as noops, leaving it up to subclasses to handle object updates.
- Since:
- 1.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a graph node given an id.Returns an immutable collection of registered nodes.voidregisterNode(Object nodeId, Object nodeObject) "Registers" a graph node, usually storing the node in some internal map using its id as a key.unregisterNode(Object nodeId) "Unregisters" a graph node, forgetting any information associated with nodeId.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GraphChangeHandler
arcCreated, arcDeleted, nodeCreated, nodeIdChanged, nodePropertyChanged, nodeRemovedModifier and TypeMethodDescriptiondefault voidarcCreated(Object nodeId, Object targetNodeId, ArcId arcId) Notifies implementing object that a new arc was created between two nodes.default voidarcDeleted(Object nodeId, Object targetNodeId, ArcId arcId) Notifies implementing object that an arc between two nodes was deleted.default voidnodeCreated(Object nodeId) Notifies implementing object that a new node was created in the graph.default voidnodeIdChanged(Object nodeId, Object newId) Notifies implementing object that a node was assigned a new id.default voidnodePropertyChanged(Object nodeId, String property, Object oldValue, Object newValue) Notifies implementing object that a node's property was modified.default voidnodeRemoved(Object nodeId) Notifies implementing object that a node was removed from the graph.
-
Field Details
-
nodes
-
-
Constructor Details
-
GraphMap
public GraphMap()Creates a new GraphMap.
-
-
Method Details
-
registeredNodes
Returns an immutable collection of registered nodes.- Specified by:
registeredNodesin interfaceGraphManager
-
getNode
Description copied from interface:GraphManagerReturns a graph node given an id.- Specified by:
getNodein interfaceGraphManager
-
registerNode
Description copied from interface:GraphManager"Registers" a graph node, usually storing the node in some internal map using its id as a key.- Specified by:
registerNodein interfaceGraphManager
-
unregisterNode
Description copied from interface:GraphManager"Unregisters" a graph node, forgetting any information associated with nodeId.- Specified by:
unregisterNodein interfaceGraphManager
-