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.
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) |
ScopeDump | ( | HashMap< Long, String > | threadDictionary, |
String | noKeyHashKey, | ||
AString | target, | ||
int | maxKeyLength | ||
) |
Constructor
threadDictionary | User-defined threads names. |
noKeyHashKey | String to identify global keys. |
target | Target string to write to. |
maxKeyLength | The start value for the maximum length of a key. |
Constructor
threadDictionary | User-defined threads names. |
target | Target string to write to. |
noKeyHashKey | String to identify global keys. |
Helper method to write a ScopeStores' source related scope key as scope information.
key | The key of the StringTree that is to be "translated". |
|
protected |
Helper method to write thread information.
thread | The thread in question |
int writeDomains | ( | ScopeStore< AString > | store, |
int | indentSpaces | ||
) |
Writes the contents of the ScopeStore used for Scope Domains
store | The store to use |
indentSpaces | The number of spaces to add at the beginning of each line. |
|
package |
Helper method.
map | The map to use. |
prefix | A prefix string for each line. |
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).
store | The store to use. |
int writePrefixes | ( | ScopeStore< Object > | store, |
int | indentSpaces | ||
) |
Writes the contents of the ScopeStore used for Prefix Logables
store | The store to use |
indentSpaces | The number of spaces to add at the beginning of each line. |
|
protected |
The maximum length of a key. Adjusts (increases) over lifecycle.
|
protected |
String to identify global keys.
|
protected |
The target to write to
|
protected |
User-defined threads names.