Package edu.cmu.tetrad.util
Class DefaultTetradLoggerConfig
java.lang.Object
edu.cmu.tetrad.util.DefaultTetradLoggerConfig
- All Implemented Interfaces:
TetradLoggerConfig
,TetradSerializable
,Serializable
Logger configuration.
- Author:
- Tyler Gibson
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface edu.cmu.tetrad.util.TetradLoggerConfig
TetradLoggerConfig.Event
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTetradLoggerConfig
(String... events) Constructs the config for the given event ids.Constructs the config given the events in it. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
boolean
isActive()
States whether the config is active or not.boolean
isEventActive
(String id) States whether the event associated with the given id is active, that is whether it should be logged or not.static DefaultTetradLoggerConfig
Generates a simple exemplar of this class to test serialization.void
setEventActive
(String id, boolean active) Sets whether the event associated with the given id is active or not.toString()
-
Constructor Details
-
DefaultTetradLoggerConfig
Constructs the config given the events in it.- Parameters:
events
- The events that the logger reports.
-
DefaultTetradLoggerConfig
Constructs the config for the given event ids. This will createEvent
s with no descriptions.- Parameters:
events
- The events that the logger reports.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization. -
copy
- Specified by:
copy
in interfaceTetradLoggerConfig
- Returns:
- a copy of this configuration.
-
isEventActive
Description copied from interface:TetradLoggerConfig
States whether the event associated with the given id is active, that is whether it should be logged or not.- Specified by:
isEventActive
in interfaceTetradLoggerConfig
-
isActive
public boolean isActive()Description copied from interface:TetradLoggerConfig
States whether the config is active or not. THe config is considered active if there is at least one active event.- Specified by:
isActive
in interfaceTetradLoggerConfig
- Returns:
- - true iff its active.
-
getSupportedEvents
- Specified by:
getSupportedEvents
in interfaceTetradLoggerConfig
- Returns:
- - events
-
setEventActive
Description copied from interface:TetradLoggerConfig
Sets whether the event associated with the given id is active or not.- Specified by:
setEventActive
in interfaceTetradLoggerConfig
-
toString
- Specified by:
toString
in interfaceTetradLoggerConfig
- Overrides:
toString
in classObject
- Returns:
- a string representation.
-