Class PeriodicReporter

  • All Implemented Interfaces:
    Reporter
    Direct Known Subclasses:
    LoggingReporter

    public abstract class PeriodicReporter
    extends java.lang.Object
    implements Reporter
    Abstract class that simplifies development of a Reporter that should only report every nth event (node or property seen).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PeriodicReporter​(int nodeLogInterval, int propertyLogInterval)  
    • Constructor Detail

      • PeriodicReporter

        protected PeriodicReporter​(int nodeLogInterval,
                                   int propertyLogInterval)
    • Method Detail

      • reset

        protected void reset()
        Reset the node and property counts to 0. Inheriting implementations may reset their own internal state.
      • reportPeriodicNode

        protected abstract void reportPeriodicNode​(long count,
                                                   @NotNull
                                                   @NotNull ReportingNodeState nodeState)
        Callback called every nth time a node is accessed.
        Parameters:
        count - The count of reported nodes.
        nodeState - The node that was reported.
      • reportPeriodicProperty

        protected abstract void reportPeriodicProperty​(long count,
                                                       @NotNull
                                                       @NotNull ReportingNodeState parent,
                                                       @NotNull
                                                       @NotNull java.lang.String propertyName)
        Callback called every nth time a property is accessed.
        Parameters:
        count - The count of reported properties.
        parent - The parent node of the reported property.
        propertyName - The name of the reported property.
      • skipNodeState

        protected boolean skipNodeState​(@NotNull
                                        @NotNull ReportingNodeState nodeState)
      • reportNode

        public final void reportNode​(@NotNull
                                     @NotNull ReportingNodeState nodeState)
        Description copied from interface: Reporter
        Callback reporting that the given nodeState was accessed.
        Specified by:
        reportNode in interface Reporter
        Parameters:
        nodeState - The accessed ReportingNodeState instance.
      • reportProperty

        public final void reportProperty​(@NotNull
                                         @NotNull ReportingNodeState parent,
                                         @NotNull
                                         @NotNull java.lang.String propertyName)
        Description copied from interface: Reporter
        Callback reporting that the property named propertyName was accessed on the parent node.
        Specified by:
        reportProperty in interface Reporter
        Parameters:
        parent - The parent node state of the reported property.
        propertyName - The name of the reported property.