Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataAnalyserModule<A>

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

Private cachedAnalysis

cachedAnalysis: A | null

Cached version of the last analysis produced by the module. Before the first analysis computation, it is set to null.

Private cachedAnalysisContentRevision

cachedAnalysisContentRevision: number

Database revision of the data used to compute the cached analysis.

Protected database

database: Database

Database where to fetch data to analyse (and the revisions).

Methods

Protected Abstract computeAnalysis

  • computeAnalysis(): A
  • Compute and return an analysis from the database data.

    Each concrete analyser module must return a fresh analysis, of the analysis type [[A]] (extending Analysis) they offer.

    Returns A

    An up-to-date analysis of the database data.

getAnalysis

  • getAnalysis(): A
  • Update the cached analysis if need be, and returns a deep copy of it.

    Returns A

    An up-to-date, deep copy of the cached analysis.

Protected makeAnalysisDeepCopy

  • makeAnalysisDeepCopy(analysis: A): A
  • Make a deep copy of the given analysis.

    This method should be overidden by any concrete analyser module if need be, e.g. to make deep copies of data structures not handled by the JSON (de)serialization copy technique implemented by default.

    Parameters

    • analysis: A

      The analysis to copy.

    Returns A

    A deep copy of the given analysis.

Private needsAnalysisUpdate

  • needsAnalysisUpdate(): boolean
  • Test whether the analysis needs to be updated (computed anew):

    • If no analysis has been computed yet;
    • Or if the revision has changed since the last cached analysis computation.

    Returns boolean

    true if it needs to be updated, false otherwise.

Private updateContentRevision

  • updateContentRevision(): void
  • Update the revision asssociated with the last cached analysis, using the current revision of the database.

    Returns void

Generated using TypeDoc