Package org.apache.cayenne.graph
Class GraphMap
java.lang.Object
org.apache.cayenne.graph.GraphMap
- All Implemented Interfaces:
- GraphChangeHandler,- GraphManager
public class GraphMap extends Object implements 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
- 
Constructor SummaryConstructors Constructor Description GraphMap()Creates a new GraphMap.
- 
Method SummaryModifier and Type Method Description voidarcCreated(Object nodeId, Object targetNodeId, Object arcId)Notifies implementing object that a new arc was created between two nodes.voidarcDeleted(Object nodeId, Object targetNodeId, Object arcId)Notifies implementing object that an arc between two nodes was deleted.ObjectgetNode(Object nodeId)Returns a graph node given an id.voidnodeCreated(Object nodeId)Notifies implementing object that a new node was created in the graph.voidnodeIdChanged(Object nodeId, Object newId)Notifies implementing object that a node was assigned a new id.voidnodePropertyChanged(Object nodeId, String property, Object oldValue, Object newValue)Notifies implementing object that a node's property was modified.voidnodeRemoved(Object nodeId)Notifies implementing object that a node was removed from the graph.Collection<Object>registeredNodes()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.ObjectunregisterNode(Object nodeId)"Unregisters" a graph node, forgetting any information associated with nodeId.
- 
Field Details- 
nodes
 
- 
- 
Constructor Details- 
GraphMappublic GraphMap()Creates a new GraphMap.
 
- 
- 
Method Details- 
registeredNodesReturns an immutable collection of registered nodes.- Specified by:
- registeredNodesin interface- GraphManager
 
- 
getNodeDescription copied from interface:GraphManagerReturns a graph node given an id.- Specified by:
- getNodein interface- GraphManager
 
- 
registerNodeDescription 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 interface- GraphManager
 
- 
unregisterNodeDescription copied from interface:GraphManager"Unregisters" a graph node, forgetting any information associated with nodeId.- Specified by:
- unregisterNodein interface- GraphManager
 
- 
arcCreatedDescription copied from interface:GraphChangeHandlerNotifies implementing object that a new arc was created between two nodes.- Specified by:
- arcCreatedin interface- GraphChangeHandler
 
- 
arcDeletedDescription copied from interface:GraphChangeHandlerNotifies implementing object that an arc between two nodes was deleted.- Specified by:
- arcDeletedin interface- GraphChangeHandler
 
- 
nodeCreatedDescription copied from interface:GraphChangeHandlerNotifies implementing object that a new node was created in the graph.- Specified by:
- nodeCreatedin interface- GraphChangeHandler
 
- 
nodeRemovedDescription copied from interface:GraphChangeHandlerNotifies implementing object that a node was removed from the graph.- Specified by:
- nodeRemovedin interface- GraphChangeHandler
 
- 
nodeIdChangedDescription copied from interface:GraphChangeHandlerNotifies implementing object that a node was assigned a new id.- Specified by:
- nodeIdChangedin interface- GraphChangeHandler
 
- 
nodePropertyChangedDescription copied from interface:GraphChangeHandlerNotifies implementing object that a node's property was modified.- Specified by:
- nodePropertyChangedin interface- GraphChangeHandler
 
 
-