storage.memory
Class memMapContent

java.lang.Object
  extended bystorage.memory.memContent
      extended bystorage.memory.memMapContent
All Implemented Interfaces:
storage.memory.MemContentI

public final class memMapContent
extends memContent

The canonical implementation of a MapContent object in memory. This implementation also contains subclasses for implementing Map and MapEditor given a Node that is using this class as its memContent.


Field Summary
protected  java.util.HashMap content
           
protected  CacheMap getters
           
protected  MapType mapType
           
 
Fields inherited from class storage.memory.memContent
allContents, nodeContents
 
Method Summary
 java.util.Map asMap()
           
protected  NodeContent createNodeContent(Node n, Capability cap, storage.framework.RepoServices s)
          Create a NodeContent object with the memContent, and the given Node, Capability, and RepoServices.
 boolean isValidProperty(java.lang.Object property)
          Check for the validity of a given property value.
 java.util.Iterator properties()
          A sequence of all of the properties currently indexing the contents if this Content.
 int size()
          The number of properties contained in this Content object.
 NodeType type()
          The type of this Content object.
 Getter value(java.lang.Object key, NodeContent node)
          A generic Getter for property values, given a property.
protected  GetterUtil valueGetter(java.lang.Object key, NodeContent c)
          Create or find a GetterUtil for this key.
 
Methods inherited from class storage.memory.memContent
assignNode, create, findNodeContent, getValue, ingest, initEdit, invert, invert, modify, nodeContent, rememberNodeContent, seatNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapType

protected final MapType mapType

content

protected java.util.HashMap content

getters

protected CacheMap getters
Method Detail

createNodeContent

protected NodeContent createNodeContent(Node n,
                                        Capability cap,
                                        storage.framework.RepoServices s)
Description copied from class: memContent
Create a NodeContent object with the memContent, and the given Node, Capability, and RepoServices.

Specified by:
createNodeContent in class memContent
Parameters:
n - a Node associated with this memContent
cap - a Capability restricting access to operations
s - the RepoServices needed to manage Txns and create Nodes
Returns:
a new NodeContent object

asMap

public java.util.Map asMap()

type

public NodeType type()
Description copied from interface: storage.memory.MemContentI
The type of this Content object.

Necessarily a NodeType type, and always a specific instance of MapType, RecordType or SequenceType.


size

public int size()
Description copied from interface: storage.memory.MemContentI
The number of properties contained in this Content object.


properties

public java.util.Iterator properties()
Description copied from interface: storage.memory.MemContentI
A sequence of all of the properties currently indexing the contents if this Content.


valueGetter

protected GetterUtil valueGetter(java.lang.Object key,
                                 NodeContent c)
                          throws PropertyTypeMismatch
Create or find a GetterUtil for this key.

Throws:
PropertyTypeMismatch

value

public Getter value(java.lang.Object key,
                    NodeContent node)
             throws PropertyTypeMismatch
Description copied from interface: storage.memory.MemContentI
A generic Getter for property values, given a property.

Will throw an exception if the property type is invalid, but not if the property is not available in this Node's content. This way, a value Getter can be established in anticipation of the addition of a property.

Parameters:
key - the Object that identifies this property
Throws:
PropertyTypeMismatch

isValidProperty

public boolean isValidProperty(java.lang.Object property)
Description copied from interface: storage.memory.MemContentI
Check for the validity of a given property value.

Parameters:
property - the property to be checked
Returns:
true if that value can be used as a property of this Node