SPT Object Database API

com.sptci.prevayler
Class ReferenceStorage.FieldStorage

java.lang.Object
  extended by com.sptci.prevayler.ReferenceStorage.FieldStorage
All Implemented Interfaces:
Serializable
Enclosing class:
ReferenceStorage

private class ReferenceStorage.FieldStorage
extends Object
implements Serializable

The storage for all the references fields in a prevalent object.


Field Summary
private  Map<String,Object> fieldStorage
          The map used to maintain the field name to object id mappings.
private static long serialVersionUID
           
 
Constructor Summary
private ReferenceStorage.FieldStorage()
           
 
Method Summary
private  void add(String name, Object oid)
          Add the specified mapping to the store.
private  Collection<String> getFields()
          Return a collection of field names that are stored in in this store.
private  Object getValue(String name)
          Return the value associated with the field with the specified name.
private  void remove(String name)
          Remove the mapping for the specified field from fieldStorage.
private  void remove(String name, Object objectId)
          Remove the specified reference from the field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

fieldStorage

private final Map<String,Object> fieldStorage
The map used to maintain the field name to object id mappings.

Constructor Detail

ReferenceStorage.FieldStorage

private ReferenceStorage.FieldStorage()
Method Detail

add

private void add(String name,
                 Object oid)
Add the specified mapping to the store.

Parameters:
name - The name of the reference field.
oid - The oid value for the referenced object.

remove

private void remove(String name)
Remove the mapping for the specified field from fieldStorage.

Parameters:
name - The name of the reference field whose mapping is to be removed.

remove

private void remove(String name,
                    Object objectId)
Remove the specified reference from the field. If the field contains a collection of references, then the specified reference is removed from the collection. Otherwise this method is identical to remove( String ).

Parameters:
name - The name of the reference field whose mapping is to be removed.
objectId - The object id that is to be removed from the mapping.

getFields

private Collection<String> getFields()
Return a collection of field names that are stored in in this store.

Returns:
The collection of field names.

getValue

private Object getValue(String name)
Return the value associated with the field with the specified name.

Parameters:
name - The name of the field whose value is to be retrieved.
Returns:
The value associated with the name.

SPT Object Database API