Class MostCommon
- java.lang.Object
-
- adams.core.logging.ConsoleLoggingObject
-
- adams.gui.flow.tree.record.enclose.AbstractRecordActorEnclosed
-
- adams.gui.flow.tree.record.enclose.MostCommon
-
- All Implemented Interfaces:
CleanUpHandler
,Serializable
public class MostCommon extends AbstractRecordActorEnclosed
Maintains a top X list of actor handlers that were used to enclose actors.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
FILENAME
the file to write the "add" history to .protected static NamedCounter
m_Counter
the count per actor.protected static DelayedActionRunnable
m_SaveRunnable
for delaying the saving.protected static Thread
m_SaveThread
the threading for saving.-
Fields inherited from class adams.gui.flow.tree.record.enclose.AbstractRecordActorEnclosed
m_Recorders
-
Fields inherited from class adams.core.logging.ConsoleLoggingObject
m_Logger
-
-
Constructor Summary
Constructors Constructor Description MostCommon()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.protected void
doRecord(Tree tree, TreePath[] paths, ActorHandler handler)
Records the enclosing action.protected static String
getFilename()
Returns the filename for storing the data.static List<String>
getMostCommon(int max)
Returns the X most common actors.protected static void
initCounter()
Initializes the counter.boolean
isEnabled(Tree tree)
Returns whether the recording is active.protected static String
save()
Performs the actual save operation.protected static void
saveCounter()
Saves the counter as CSV file.-
Methods inherited from class adams.gui.flow.tree.record.enclose.AbstractRecordActorEnclosed
cleanUpAll, record, recordAll
-
Methods inherited from class adams.core.logging.ConsoleLoggingObject
getLogger, initializeLogger, isLoggingEnabled
-
-
-
-
Field Detail
-
FILENAME
public static final String FILENAME
the file to write the "add" history to .- See Also:
- Constant Field Values
-
m_SaveRunnable
protected static DelayedActionRunnable m_SaveRunnable
for delaying the saving.
-
m_SaveThread
protected static Thread m_SaveThread
the threading for saving.
-
m_Counter
protected static NamedCounter m_Counter
the count per actor.
-
-
Method Detail
-
isEnabled
public boolean isEnabled(Tree tree)
Returns whether the recording is active.- Specified by:
isEnabled
in classAbstractRecordActorEnclosed
- Parameters:
tree
- the current tree- Returns:
- true if active
-
getFilename
protected static String getFilename()
Returns the filename for storing the data.- Returns:
- the filename
-
initCounter
protected static void initCounter()
Initializes the counter.
-
save
protected static String save()
Performs the actual save operation.
-
saveCounter
protected static void saveCounter()
Saves the counter as CSV file.
-
doRecord
protected void doRecord(Tree tree, TreePath[] paths, ActorHandler handler)
Records the enclosing action.- Specified by:
doRecord
in classAbstractRecordActorEnclosed
- Parameters:
tree
- the contextpaths
- the paths to addhandler
- the handler to enclose the paths with
-
getMostCommon
public static List<String> getMostCommon(int max)
Returns the X most common actors.- Parameters:
max
- the maximum number of actors, <= 0 for all- Returns:
- the list of actor names
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classAbstractRecordActorEnclosed
-
-