Package com.e1c.langtool.internal.stat
Class CompositeStatisticsManager
java.lang.Object
com.e1c.langtool.internal.stat.CompositeStatisticsManager
- All Implemented Interfaces:
StatisticsManager
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeStatisticsManager(org.eclipse.core.resources.IProject project, ProjectMetricStorage storage, StatisticsService statisticsService, ITranslatingProjectManager translatingProjectManager, ITranslationStorageManager storageManager, AsyncRecomputer recomputer, IExporterRegistry exporterRegistry) Constructs a new composite statistics manager for aggregating and managing project statistics. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidexportStatistics(Path path, String type) Exports statistics to an external file in the specified format.protected voidfireChange(StatisticsChangeEvent event) org.eclipse.core.resources.IProjectGets the project to edit statistics.voidRemove all statistics in this manager for all sources and all languagesvoidremoveStatistic(TranslateLanguage language) Remove statistics for given language.voidremoveStatistic(org.eclipse.core.runtime.IPath path) Remove statistics for given path ofTranslationSourcefor allTranslationLanguages.voidremoveStatistic(org.eclipse.core.runtime.IPath path, TranslateLanguage language) Remove statistics for given path ofTranslationSourceandTranslationLanguage.voidvoidRecompute full statistics.voidupdateFullStatistic(org.eclipse.core.runtime.IPath path, Statistics statistics) Update full statistics.voidupdateLanguageStatistic(org.eclipse.core.runtime.IPath path, TranslateLanguage language, Statistics statistics) Update statistics.voidupdateProjectLanguageStatistic(TranslateLanguage language, Statistics statistics) Update project language statistics.voidupdateProjectStatistic(Statistics statistics) Update project statistics.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.langtool.stat.StatisticsManager
removeStatistic, removeStatistic, updateFullStatistic, updateLanguageStatistic
-
Constructor Details
-
CompositeStatisticsManager
public CompositeStatisticsManager(org.eclipse.core.resources.IProject project, ProjectMetricStorage storage, StatisticsService statisticsService, ITranslatingProjectManager translatingProjectManager, ITranslationStorageManager storageManager, AsyncRecomputer recomputer, IExporterRegistry exporterRegistry) Constructs a new composite statistics manager for aggregating and managing project statistics. It integrates various services and managers to provide cohesive statistics management.- Parameters:
project- Project for which to manage statistics, cannot benull.storage- Storage for project metrics, cannot benull.statisticsService- Service for statistical data calculation and retrieval, cannot benull.translatingProjectManager- Manager for project translations, cannot benull.storageManager- Manager for translation data storage, cannot benull.recomputer- Asynchronous recomputer for statistics, cannot benull.exporterRegistry- Registry of data exporters, cannot benull. Initializes a translation reader from the storage manager and registers a storage listener to it, ensuring statistics update with translation changes.
-
-
Method Details
-
getProject
public org.eclipse.core.resources.IProject getProject()Description copied from interface:StatisticsManagerGets the project to edit statistics.- Specified by:
getProjectin interfaceStatisticsManager- Returns:
- the project, cannot return
null.
-
updateProjectStatistic
Description copied from interface:StatisticsManagerUpdate project statistics.- Specified by:
updateProjectStatisticin interfaceStatisticsManager- Parameters:
statistics- the statistics, cannot benull.
-
updateProjectLanguageStatistic
Description copied from interface:StatisticsManagerUpdate project language statistics.- Specified by:
updateProjectLanguageStatisticin interfaceStatisticsManager- Parameters:
language- the language, cannot benull.statistics- the statistics, cannot benull.
-
updateFullStatistic
Description copied from interface:StatisticsManagerUpdate full statistics.- Specified by:
updateFullStatisticin interfaceStatisticsManager- Parameters:
path- the translation source path, cannot benull.statistics- the statistics that may contain all data for each languages, or absent data for all languages will be cleaned. Cannot benull.
-
updateLanguageStatistic
public void updateLanguageStatistic(org.eclipse.core.runtime.IPath path, TranslateLanguage language, Statistics statistics) Description copied from interface:StatisticsManagerUpdate statistics.- Specified by:
updateLanguageStatisticin interfaceStatisticsManagerlanguage- the language, cannot benull.
-
removeStatistic
public void removeStatistic()Description copied from interface:StatisticsManagerRemove all statistics in this manager for all sources and all languages- Specified by:
removeStatisticin interfaceStatisticsManager
-
removeStatistic
Description copied from interface:StatisticsManagerRemove statistics for given language.- Specified by:
removeStatisticin interfaceStatisticsManager- Parameters:
language- the language, cannot benull.
-
removeStatistic
public void removeStatistic(org.eclipse.core.runtime.IPath path) Description copied from interface:StatisticsManagerRemove statistics for given path ofTranslationSourcefor allTranslationLanguages.- Specified by:
removeStatisticin interfaceStatisticsManager- Parameters:
path- the path, cannot benull.
-
removeStatistic
Description copied from interface:StatisticsManagerRemove statistics for given path ofTranslationSourceandTranslationLanguage.- Specified by:
removeStatisticin interfaceStatisticsManager- Parameters:
path- the path, cannot benull.language- the language, cannot benull.
-
startRecomputeFullStatistic
public void startRecomputeFullStatistic()Description copied from interface:StatisticsManagerRecompute full statistics.- Specified by:
startRecomputeFullStatisticin interfaceStatisticsManager
-
exportStatistics
Description copied from interface:StatisticsManagerExports statistics to an external file in the specified format.- Specified by:
exportStatisticsin interfaceStatisticsManager- Parameters:
path- the path to the file where the statistics will be exported, cannot benull.type- the statistics type, cannot benull- Throws:
IOException- Signals that an I/O exception has occurred.
-
addStatisticChangeListener
-
removeStatisticChangeListener
-
fireChange
-