|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.graph.connector.base.MapWorkspace<NodeType> org.modeshape.graph.connector.base.StandardMapWorkspace<NodeType>
NodeType
- the type of node@NotThreadSafe public class StandardMapWorkspace<NodeType extends MapNode>
The Workspace
implementation that represents all nodes as MapNode
objects and stores them within a
Map
keyed by their UUID.
Subclasses are required to provide thread-safe access and modification of the state within the encapsulated map, since multiple
Transaction
implementations may be committing
changes to the map at the same time.
However, this class does not provide any thread-safety, since the nature of the thread-safety will almost certainly depend on
the actual map implementation. For example, a subclass may use a lock
, or it may use a map implementation
that provides the thread-safety.
Field Summary |
---|
Fields inherited from class org.modeshape.graph.connector.base.MapWorkspace |
---|
name, rootNodeUuid |
Constructor Summary | |
---|---|
StandardMapWorkspace(String name,
Map<UUID,NodeType> nodesByUuid,
NodeType rootNode)
Create a new instance of the workspace. |
|
StandardMapWorkspace(String name,
Map<UUID,NodeType> nodesByUuid,
StandardMapWorkspace<NodeType> originalToClone)
Create a new instance of the workspace. |
Method Summary | |
---|---|
NodeType |
getNode(UUID uuid)
Get the node with the supplied UUID. |
NodeType |
putNode(NodeType node)
Add the node into this workspace's map, overwriting any previous record of the node |
void |
removeAll()
Remove all of the nodes in this workspace, and make sure there is a single root node with no properties and no children. |
NodeType |
removeNode(UUID uuid)
Remove and return the node with the supplied UUID. |
Methods inherited from class org.modeshape.graph.connector.base.MapWorkspace |
---|
getName, getRootNode, getRootNodeUuid, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StandardMapWorkspace(String name, Map<UUID,NodeType> nodesByUuid, NodeType rootNode)
name
- the workspace name; may not be nullnodesByUuid
- the map of nodes keyed by their UUIDs; may not be nullrootNode
- the root node that is expected to already exist in the mappublic StandardMapWorkspace(String name, Map<UUID,NodeType> nodesByUuid, StandardMapWorkspace<NodeType> originalToClone)
name
- the workspace name; may not be nullnodesByUuid
- the map of nodes keyed by their UUIDs; may not be nulloriginalToClone
- the workspace that is to be cloned; may not be nullMethod Detail |
---|
public NodeType getNode(UUID uuid)
getNode
in class MapWorkspace<NodeType extends MapNode>
uuid
- the UUID of the node
public NodeType putNode(NodeType node)
putNode
in class MapWorkspace<NodeType extends MapNode>
node
- the new node; may not be null
public NodeType removeNode(UUID uuid)
removeNode
in class MapWorkspace<NodeType extends MapNode>
uuid
- the UUID of the node to be removed
public void removeAll()
removeAll
in class MapWorkspace<NodeType extends MapNode>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |