story.scheherazade.elements
Class NarrativeSymbolTable

java.lang.Object
  extended by story.scheherazade.elements.NarrativeSymbolTable

public class NarrativeSymbolTable
extends java.lang.Object

This is a master symbol table for Narratives that hashes from SCH-level names (e.g., CharacterName) to their NodeAddress declaration nodes. IMPORTANT: It is tempting to want to link from names to the more durable NodeProxies. However, this symbol table is copied and included as part of the undo/redo memento. Only NodeAddresses persist across undo/redo; NodeProxies, being surrogates for specific object instantiations, end up pointing to null after an undo. That is why we link to NodeAddress here.


Constructor Summary
NarrativeSymbolTable(DBCAccessor dbca)
           
 
Method Summary
 void declareElementNode(java.lang.String key, NodeAddress declarationNode)
           
 void declareElementNode(java.lang.String key, NodeProxy declarationNode)
           
 NodeAddress getDeclaredElementNode(java.lang.String key)
           
 boolean isDeclared(java.lang.String key)
           
 NarrativeSymbolTable makeCopy()
           
 java.lang.String makeSymbolTableKey(NodeAddress timeline, GenericScheherID ID)
           
 java.lang.String makeSymbolTableKey(TimelineID ID, int storyID)
           
 java.lang.StringBuffer render()
           
 void undeclareElementNode(java.lang.String key)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NarrativeSymbolTable

public NarrativeSymbolTable(DBCAccessor dbca)
Method Detail

makeCopy

public NarrativeSymbolTable makeCopy()

makeSymbolTableKey

public java.lang.String makeSymbolTableKey(NodeAddress timeline,
                                           GenericScheherID ID)
                                    throws Scheherexception
Throws:
Scheherexception

makeSymbolTableKey

public java.lang.String makeSymbolTableKey(TimelineID ID,
                                           int storyID)
                                    throws Scheherexception
Throws:
Scheherexception

declareElementNode

public void declareElementNode(java.lang.String key,
                               NodeAddress declarationNode)
                        throws Scheherexception
Throws:
Scheherexception

declareElementNode

public void declareElementNode(java.lang.String key,
                               NodeProxy declarationNode)
                        throws Scheherexception
Throws:
Scheherexception

undeclareElementNode

public void undeclareElementNode(java.lang.String key)
                          throws Scheherexception
Throws:
Scheherexception

isDeclared

public boolean isDeclared(java.lang.String key)
                   throws Scheherexception
Throws:
Scheherexception

getDeclaredElementNode

public NodeAddress getDeclaredElementNode(java.lang.String key)
                                   throws Scheherexception
Throws:
Scheherexception

render

public java.lang.StringBuffer render()
                              throws Scheherexception
Throws:
Scheherexception


Copyright © 2011 David K. Elson. All Rights Reserved.