ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Methods | Protected Fields | Protected Methods | Package Access Methods | List of all members
ScopeDump Class Reference
Collaboration diagram for ScopeDump:
[legend]

Class Description


This class is an internal helper to export current scope values. It was extracted from class Lox to keep that class clean from this somehow 'cluttered' code.

The current purpose of this class is to write information into an AString buffer. This is used by method Lox.state. In the future, other export formats, like JSON might be implemented here.

Note
As this is a pure internal helper class. Documentation may be limited.

Public Methods

 ScopeDump (HashMap< Long, String > threadDictionary, String noKeyHashKey, AString target)
 
 ScopeDump (HashMap< Long, String > threadDictionary, String noKeyHashKey, AString target, int maxKeyLength)
 
int writeDomains (ScopeStore< AString > store, int indentSpaces)
 
int writeMap (ScopeStore<?> store)
 
int writePrefixes (ScopeStore< Object > store, int indentSpaces)
 

Protected Fields

AString key = new AString()
 
int maxKeyLength
 
String noKeyHashKey
 
AString target
 
AString tempAS = new AString()
 
HashMap< Long, String > threadDictionary
 

Protected Methods

AString storeKeyToScope (AString key)
 
AString storeThreadToScope (Thread thread)
 

Package Access Methods

int writeMap (HashMap< AString, ?> map, String prefix)
 

Constructor & Destructor Documentation

◆ ScopeDump() [1/2]

ScopeDump ( HashMap< Long, String >  threadDictionary,
String  noKeyHashKey,
AString  target,
int  maxKeyLength 
)

Constructor

Parameters
threadDictionaryUser-defined threads names.
noKeyHashKeyString to identify global keys.
targetTarget string to write to.
maxKeyLengthThe start value for the maximum length of a key.

◆ ScopeDump() [2/2]

ScopeDump ( HashMap< Long, String >  threadDictionary,
String  noKeyHashKey,
AString  target 
)

Constructor

Parameters
threadDictionaryUser-defined threads names.
targetTarget string to write to.
noKeyHashKeyString to identify global keys.

Member Function Documentation

◆ storeKeyToScope()

AString storeKeyToScope ( AString  key)
protected

Helper method to write a ScopeStores' source related scope key as scope information.

Parameters
keyThe key of the StringTree that is to be "translated".
Returns
The target to allow concatenated calls.

◆ storeThreadToScope()

AString storeThreadToScope ( Thread  thread)
protected

Helper method to write thread information.

Parameters
threadThe thread in question
Returns
The target to allow concatenated calls.

◆ writeDomains()

int writeDomains ( ScopeStore< AString store,
int  indentSpaces 
)

Writes the contents of the ScopeStore used for Scope Domains

Parameters
storeThe store to use
indentSpacesThe number of spaces to add at the beginning of each line.
Returns
The total number of Scope Domains written.

◆ writeMap() [1/2]

int writeMap ( HashMap< AString, ?>  map,
String  prefix 
)
package

Helper method.

Parameters
mapThe map to use.
prefixA prefix string for each line.
Returns
The number of objects written.

◆ writeMap() [2/2]

int writeMap ( ScopeStore<?>  store)

Writes hash tables stored in a ScopeStore. Keys are AStrings. Value types currently supported are LogData and int (in C# different method).

Parameters
storeThe store to use.
Returns
The total number of hash table entries written.

◆ writePrefixes()

int writePrefixes ( ScopeStore< Object >  store,
int  indentSpaces 
)

Writes the contents of the ScopeStore used for Prefix Logables

Parameters
storeThe store to use
indentSpacesThe number of spaces to add at the beginning of each line.
Returns
The total number of Prefix Logables written.

Member Data Documentation

◆ key

AString key = new AString()
protected

Temporary, reused string

◆ maxKeyLength

int maxKeyLength
protected

The maximum length of a key. Adjusts (increases) over lifecycle.

◆ noKeyHashKey

String noKeyHashKey
protected

String to identify global keys.

◆ target

AString target
protected

The target to write to

◆ tempAS

AString tempAS = new AString()
protected

Temporary, reused string

◆ threadDictionary

HashMap<Long, String> threadDictionary
protected

User-defined threads names.


The documentation for this class was generated from the following file: