edu.ksu.cis.projects.bogor.module
Class DefaultStateExternalizer

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.module.DefaultStateExternalizer
All Implemented Interfaces:
INonPrimitiveValueIdTracker

public class DefaultStateExternalizer
extends Object
implements INonPrimitiveValueIdTracker

Version:
CVS $Revision: 1.15 $ $Date: 2005/05/26 18:23:13 $
Author:
Robby , Matt Hoosier

Field Summary
protected  IntObjectTable<String> arrayFieldNameMap
           
protected  IntObjectTable<String> globalNameMap
           
protected static String INDENT
           
protected static String LENGTH
           
protected static String LOC_SEPARATOR
           
protected  HashMap<String,List<String>> localNameMap
           
protected  IValueArray[] localStack
           
protected  int[] locationStack
           
protected  IntIntTable nonPrimitiveTypeInstanceMap
           
protected  HashMap<INonPrimitiveValue,String> nonPrimitiveValueIdMap
           
protected  PrintWriter pw
           
protected  IntObjectTable<List<String>> recordFieldNameMap
           
protected  IState state
           
protected  SymbolTable symbolTable
           
protected  IntObjectTable<String> threadIdMap
           
protected  ObjectIntTable<String> threadInstanceMap
           
protected  IValueFactory vf
           
 
Constructor Summary
DefaultStateExternalizer()
           
 
Method Summary
 void connect(IBogorConfiguration bc)
           
 void dispose()
           
protected  String en(String s)
           
 void externalizeArrayElement(IArrayValue value, int elementIndex)
           
 void externalizeArrayField(IArrayValue value, int fieldIndex)
           
 void externalizeArrayHeapElement(IArrayValue element)
           
 void externalizeArrayValue(int indents, IArrayValue value)
           
 void externalizeDoubleValue(int indents, IDoubleValue value)
           
 void externalizeExtHeapElement(INonPrimitiveExtValue element)
           
 void externalizeExtValue(int indents, INonPrimitiveExtValue value)
           
 void externalizeFloatValue(int indents, IFloatValue value)
           
 void externalizeGlobal(int globalIndex)
           
 void externalizeGlobals()
           
 void externalizeHeap()
           
 void externalizeHeapElement(INonPrimitiveValue element)
           
 void externalizeIntValue(int indents, IIntValue value)
           
 void externalizeLockHeapElement(ILockValue element)
           
protected  void externalizeLockHeapElementHelper(ILockValue element)
           
 void externalizeLockValue(int indents, ILockValue value)
           
 void externalizeLongValue(int indents, ILongValue value)
           
 void externalizeNullValue(int indents, INullValue value)
           
 void externalizePrimitiveExtValue(int indents, IPrimitiveExtValue value)
           
 void externalizeRecordField(IRecordValue value, int fieldIndex)
           
 void externalizeRecordHeapElement(IRecordValue element)
           
 void externalizeRecordValue(int indents, IRecordValue value)
           
 void externalizeState(PrintWriter pw, IState state, String stateId)
           
 void externalizeStringValue(int indents, IStringValue value)
           
 void externalizeThread(int threadId)
           
 void externalizeThreads()
           
 void externalizeThreadStackFrame(int threadId, int stackFrame)
           
 void externalizeTransition(int threadId, Transformation t)
           
 void externalizeTransitions(PrintWriter pw, IState state, int[] threadIds, Transformation[] ts)
           
 void externalizeValue(int indents, IValue value)
           
protected  void externalizeVar(int indents, String id, IValue value)
           
protected  ArrayList<INonPrimitiveValue> getHeapElements()
           
protected  String getLocalName(String fsmId, int localIndex)
           
 String getNonPrimitiveValueId(INonPrimitiveValue value)
          Gets the non-primitive value id of a non-primitive value.
 HashMap getNonPrimitiveValueIdMap()
           
protected  List<String> getRecordFieldNames(int recordTypeId)
           
protected  String getThreadId(int threadId)
           
 IntObjectTable getThreadIdMap()
           
protected  IntIntTable getThreadOrderMap()
           
 void newTrace()
           
protected  void printIndents(int indents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDENT

protected static final String INDENT
See Also:
Constant Field Values

LENGTH

protected static final String LENGTH
See Also:
Constant Field Values

LOC_SEPARATOR

protected static final String LOC_SEPARATOR
See Also:
Constant Field Values

symbolTable

protected SymbolTable symbolTable

vf

protected IValueFactory vf

pw

protected PrintWriter pw

globalNameMap

protected IntObjectTable<String> globalNameMap

arrayFieldNameMap

protected IntObjectTable<String> arrayFieldNameMap

recordFieldNameMap

protected IntObjectTable<List<String>> recordFieldNameMap

localNameMap

protected HashMap<String,List<String>> localNameMap

nonPrimitiveValueIdMap

protected HashMap<INonPrimitiveValue,String> nonPrimitiveValueIdMap

nonPrimitiveTypeInstanceMap

protected IntIntTable nonPrimitiveTypeInstanceMap

threadInstanceMap

protected ObjectIntTable<String> threadInstanceMap

threadIdMap

protected IntObjectTable<String> threadIdMap

state

protected IState state

locationStack

protected int[] locationStack

localStack

protected IValueArray[] localStack
Constructor Detail

DefaultStateExternalizer

public DefaultStateExternalizer()
Method Detail

getNonPrimitiveValueId

public String getNonPrimitiveValueId(INonPrimitiveValue value)
Description copied from interface: INonPrimitiveValueIdTracker
Gets the non-primitive value id of a non-primitive value.

Specified by:
getNonPrimitiveValueId in interface INonPrimitiveValueIdTracker
Parameters:
value - The non-primitive value whose id is requested. Must be non-null.
Returns:
The non-primitive value's id.

getNonPrimitiveValueIdMap

public HashMap getNonPrimitiveValueIdMap()

getThreadIdMap

public IntObjectTable getThreadIdMap()

connect

public void connect(IBogorConfiguration bc)

dispose

public void dispose()

externalizeArrayElement

public void externalizeArrayElement(IArrayValue value,
                                    int elementIndex)

externalizeArrayField

public void externalizeArrayField(IArrayValue value,
                                  int fieldIndex)

externalizeArrayHeapElement

public void externalizeArrayHeapElement(IArrayValue element)

externalizeArrayValue

public void externalizeArrayValue(int indents,
                                  IArrayValue value)

externalizeDoubleValue

public void externalizeDoubleValue(int indents,
                                   IDoubleValue value)

externalizeExtHeapElement

public void externalizeExtHeapElement(INonPrimitiveExtValue element)

externalizeExtValue

public void externalizeExtValue(int indents,
                                INonPrimitiveExtValue value)

externalizeFloatValue

public void externalizeFloatValue(int indents,
                                  IFloatValue value)

externalizeGlobal

public void externalizeGlobal(int globalIndex)

externalizeGlobals

public void externalizeGlobals()

externalizeHeap

public void externalizeHeap()

externalizeHeapElement

public void externalizeHeapElement(INonPrimitiveValue element)

externalizeIntValue

public void externalizeIntValue(int indents,
                                IIntValue value)

externalizeLockHeapElement

public void externalizeLockHeapElement(ILockValue element)

externalizeLockValue

public void externalizeLockValue(int indents,
                                 ILockValue value)

externalizeLongValue

public void externalizeLongValue(int indents,
                                 ILongValue value)

externalizeNullValue

public void externalizeNullValue(int indents,
                                 INullValue value)

externalizePrimitiveExtValue

public void externalizePrimitiveExtValue(int indents,
                                         IPrimitiveExtValue value)

externalizeRecordField

public void externalizeRecordField(IRecordValue value,
                                   int fieldIndex)

externalizeRecordHeapElement

public void externalizeRecordHeapElement(IRecordValue element)

externalizeRecordValue

public void externalizeRecordValue(int indents,
                                   IRecordValue value)

externalizeState

public void externalizeState(PrintWriter pw,
                             IState state,
                             String stateId)

externalizeStringValue

public void externalizeStringValue(int indents,
                                   IStringValue value)

externalizeThread

public void externalizeThread(int threadId)

externalizeThreadStackFrame

public void externalizeThreadStackFrame(int threadId,
                                        int stackFrame)

externalizeThreads

public void externalizeThreads()

externalizeTransition

public void externalizeTransition(int threadId,
                                  Transformation t)

externalizeTransitions

public void externalizeTransitions(PrintWriter pw,
                                   IState state,
                                   int[] threadIds,
                                   Transformation[] ts)

externalizeValue

public void externalizeValue(int indents,
                             IValue value)

newTrace

public void newTrace()

getHeapElements

protected ArrayList<INonPrimitiveValue> getHeapElements()

getLocalName

protected String getLocalName(String fsmId,
                              int localIndex)

getRecordFieldNames

protected List<String> getRecordFieldNames(int recordTypeId)

getThreadId

protected String getThreadId(int threadId)

getThreadOrderMap

protected IntIntTable getThreadOrderMap()

en

protected String en(String s)

externalizeLockHeapElementHelper

protected void externalizeLockHeapElementHelper(ILockValue element)

externalizeVar

protected void externalizeVar(int indents,
                              String id,
                              IValue value)

printIndents

protected void printIndents(int indents)