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

Class Description


Objects of this class represent a Log Domain of ALox. This class is internally used by class Lox.

Inner Classes

class  LoggerData
 
class  PL
 

Public Static Fields

static final char PATH_SEPARATOR ='/'
 

Public Fields

int cntLogCalls =0
 
boolean configurationRead =false
 
ArrayList< LoggerDatadata
 
AString fullPath
 
AString name
 
Domain parent
 
ArrayList< PLprefixLogables = new ArrayList<PL>()
 
ArrayList< DomainsubDomains
 

Public Methods

 Domain (Domain parent, AString name)
 
int addLogger (Logger logger)
 
int countLoggers ()
 
Domain find (AString domainPathAS, int maxCreate, boolean[] wasCreated)
 
int getCount (int loggerNo)
 
Logger getLogger (int no)
 
Logger getLogger (String loggerName)
 
int getLoggerNo (Logger logger)
 
int getLoggerNo (String loggerName)
 
int getPriority (int loggerNo)
 
Domain getRoot ()
 
Verbosity getVerbosity (int loggerNo)
 
boolean isActive (int loggerNo, Verbosity statement)
 
void removeLogger (int loggerNo)
 
Verbosity setVerbosity (int loggerNo, Verbosity verbosity, int priority)
 
String toString ()
 

Protected Fields

AString tAString =new AString()
 
Substring tSubstring =new Substring()
 
Substring tSubstring2 =new Substring()
 

Protected Methods

void addLoggerRecursive (Logger logger)
 
Domain findRecursive (Substring domainPath, int maxCreate, boolean[] wasCreated)
 
void removeLoggerRecursive (int loggerNo)
 

Constructor & Destructor Documentation

◆ Domain()

Domain ( Domain  parent,
AString  name 
)

Constructor for domain.

Parameters
parentThe parent domain. For root domains, this is null.
nameThe name of the domain. For root domains, this is null.

Member Function Documentation

◆ addLogger()

int addLogger ( Logger  logger)

Adds a new entry in field data and recursively demands the same from its sub-domains. Checks if a logger with the same name exists.

Parameters
loggerThe logger to add.
Returns
The number of the Logger, -1 if a logger with the same name exists already.

◆ addLoggerRecursive()

void addLoggerRecursive ( Logger  logger)
protected

Internal, recursive helper of addLogger.

Parameters
loggerThe logger to add.

◆ countLoggers()

int countLoggers ( )

Returns the number of loggers stored in this domain (the same for all domains within a tree).

Returns
The number of loggers attached.

◆ find()

Domain find ( AString  domainPathAS,
int  maxCreate,
boolean[]  wasCreated 
)

Searches a domain. If not found, the domain is (or path of domains are) created in the domain tree. If the path string starts with the character defined in PATH_SEPARATOR, then the search (and creation) is done starting from the root domain of this domain and not from this domain.

Parameters
domainPathASPath and domain to search.
maxCreateThe maximum number of sub domains that are created if not found at the end of the path.
[out]wasCreatedOutput parameter that is set true if domain was not found and hence created.
Returns
The domain found or created.

◆ findRecursive()

Domain findRecursive ( Substring  domainPath,
int  maxCreate,
boolean[]  wasCreated 
)
protected

The internal recursive helper of find.

Parameters
domainPathPath to search.
maxCreateThe maximum number of sub domains that are created if not found at the end of the path.
[out]wasCreatedOutput parameter that is set true if domain was not found and hence created.
Returns
The domain found or created.

◆ getCount()

int getCount ( int  loggerNo)

Returns the number of log calls for this domain and logger.

Parameters
loggerNoThe number of the Logger whose Verbosity is requested.
Returns
The number of calls executed by this logger on this domain.

◆ getLogger() [1/2]

Logger getLogger ( int  no)

Returns logger of given number.

Parameters
noThe number of the Logger to return.
Returns
The Logger found with number no.

◆ getLogger() [2/2]

Logger getLogger ( String  loggerName)

Searches and returns the Logger given by name.

Parameters
loggerNameThe logger to search.
Returns
The Logger found corresponding to given name. If the Logger does not exist, null is returned.

◆ getLoggerNo() [1/2]

int getLoggerNo ( Logger  logger)

Returns the number of a Logger.

Parameters
loggerThe logger to search.
Returns
The number of the Logger. If the Logger does not exist, -1 is returned.

◆ getLoggerNo() [2/2]

int getLoggerNo ( String  loggerName)

Returns the number of the Logger specified by name.

Parameters
loggerNameThe logger name to search.
Returns
The number of the Logger found corresponding to given name. If the Logger does not exist, -1 is returned.

◆ getPriority()

int getPriority ( int  loggerNo)

Returns the priority of the Verbosity setting for the given logger number.

Parameters
loggerNoThe number of the Logger whose Verbosity is requested.
Returns
The priority.

◆ getRoot()

Domain getRoot ( )

Returns the root domain of this object.

Returns
The root domain of this object

◆ getVerbosity()

Verbosity getVerbosity ( int  loggerNo)

Returns the domains Verbosity for the given logger number.

Parameters
loggerNoThe number of the Logger whose Verbosity is requested.
Returns
The found/defined domain Verbosity.

◆ isActive()

boolean isActive ( int  loggerNo,
Verbosity  statement 
)

Determines if the domain is active in respect to the given Verbosity.

Parameters
loggerNoThe number of the Logger whose Verbosity is to be evaluated against statement.
statementThe Verbosity to check.
Returns
true if domain is active (log should be performed)

◆ removeLogger()

void removeLogger ( int  loggerNo)

Removes an new entry in field data and recursively demands the same from its sub-domains.

Parameters
loggerNoThe number of the Logger to be removed

◆ removeLoggerRecursive()

void removeLoggerRecursive ( int  loggerNo)
protected

Internal, recursive helper of removeLogger.

Parameters
loggerNoThe number of the Logger to be removed.

◆ setVerbosity()

Verbosity setVerbosity ( int  loggerNo,
Verbosity  verbosity,
int  priority 
)

Sets the verbosity for a logger of this domain of all its sub domains to the specified value. If given priority is lower than those actually stored, nothing is set and recursion is stopped.

Parameters
loggerNoThe number of the Logger to set the Verbosity for.
verbosityThe verbosity value to set.
priorityThe priority of the setting.
Returns
The new Verbosity.

◆ toString()

String toString ( )

This is for debugging purposes and for configuration output. E.g. this enables the Eclipse IDE to display object descriptions in the debugger.

Returns
A human readable string representation of this object.

Member Data Documentation

◆ cntLogCalls

int cntLogCalls =0

A counter for the quantity of calls on this domain. The does not include:

  • logs when no Logger was set
  • conditional logs that were suppressed Otherwise, it includes all log calls, even when no Logger was enabled on this domain.

◆ configurationRead

boolean configurationRead =false

Flag to which is set when verbosity configuration data was read.

◆ data

ArrayList<LoggerData> data

Data stored per logger. The index is corresponding to the list of loggers in 'our' Lox.

◆ fullPath

AString fullPath

The full path of the domain (set in the constructor once) .

◆ name

AString name

The name of the domain. For root domains, this is null.

◆ parent

Domain parent

The parent domain. For root domains, this is null.

◆ PATH_SEPARATOR

final char PATH_SEPARATOR ='/'
static

Domain separation character

◆ prefixLogables

ArrayList<PL> prefixLogables = new ArrayList<PL>()

Prefix Logables associated with this domain.

◆ subDomains

ArrayList<Domain> subDomains

A list of sub domains.

◆ tAString

AString tAString =new AString()
protected

A reusable AString .

◆ tSubstring

Substring tSubstring =new Substring()
protected

A reusable substring .

◆ tSubstring2

Substring tSubstring2 =new Substring()
protected

A reusable substring .


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