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

  Fields
  Modifier and Type
  Field
  Description
  `protected Map<Object,Object>`
  `nodes`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GraphMap()`
  Creates a new GraphMap.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getNode(Object nodeId)`
  Returns a graph node given an id.
  `Collection<Object>`
  `registeredNodes()`
  Returns an immutable collection of registered nodes.
  `void`
  `registerNode(Object nodeId, Object nodeObject)`
  "Registers" a graph node, usually storing the node in some internal map using its id as a key.
  `Object`
  `unregisterNode(Object nodeId)`
  "Unregisters" a graph node, forgetting any information associated with nodeId.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.cayenne.graph.GraphChangeHandler

  `arcCreated, arcDeleted, nodeCreated, nodeIdChanged, nodePropertyChanged, nodeRemoved`

- ## Field Details

  - ### nodes

    protected Map<Object,Object> nodes

- ## Constructor Details

  - ### GraphMap

    public GraphMap()
    Creates a new GraphMap.

- ## Method Details

  - ### registeredNodes

    public Collection<Object> registeredNodes()
    Returns an immutable collection of registered nodes.
    Specified by:
      `registeredNodes` in interface `GraphManager`

  - ### getNode

    public Object getNode(Object nodeId)
    Description copied from interface: `GraphManager`
    Returns a graph node given an id.
    Specified by:
      `getNode` in interface `GraphManager`

  - ### registerNode

    public void registerNode(Object nodeId, Object nodeObject)
    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:
      `registerNode` in interface `GraphManager`

  - ### unregisterNode

    public Object unregisterNode(Object nodeId)
    Description copied from interface: `GraphManager`
    "Unregisters" a graph node, forgetting any information associated with nodeId.
    Specified by:
      `unregisterNode` in interface `GraphManager`