Class AnalyticsObserver.AnalyticsData

java.lang.Object
com.university.bookstore.observer.AnalyticsObserver.AnalyticsData
Enclosing class:
AnalyticsObserver

public static class AnalyticsObserver.AnalyticsData extends Object
Comprehensive analytics data container.
Since:
2024-09-15
Version:
3.0
Author:
Navid Mohaghegh
  • Constructor Details

    • AnalyticsData

      public AnalyticsData(int totalEvents, double totalInventoryValue, int uniqueMaterialCount, Map<String,Integer> eventStatistics, Map<String,Integer> materialTypeStatistics, long firstEventTime, long lastEventTime, long eventTimeSpan, double averageEventRate)
      Creates analytics data with comprehensive statistics.
      Parameters:
      totalEvents - total number of events
      totalInventoryValue - total value of inventory
      uniqueMaterialCount - number of unique materials
      eventStatistics - map of event type to count
      materialTypeStatistics - map of material type to count
      firstEventTime - timestamp of first event
      lastEventTime - timestamp of last event
      eventTimeSpan - time span of events
      averageEventRate - average rate of events
  • Method Details

    • getTotalEvents

      public int getTotalEvents()
      Gets the total number of events. @return total number of events
    • getTotalInventoryValue

      public double getTotalInventoryValue()
      Gets the total inventory value. @return total inventory value
    • getUniqueMaterialCount

      public int getUniqueMaterialCount()
      Gets the number of unique materials. @return number of unique materials
    • getEventStatistics

      public Map<String,Integer> getEventStatistics()
      Gets the event statistics map. @return map of event type to count
    • getMaterialTypeStatistics

      public Map<String,Integer> getMaterialTypeStatistics()
      Gets the material type statistics map. @return map of material type to count
    • getFirstEventTime

      public long getFirstEventTime()
      Gets the timestamp of first event. @return timestamp of first event
    • getLastEventTime

      public long getLastEventTime()
      Gets the timestamp of last event. @return timestamp of last event
    • getEventTimeSpan

      public long getEventTimeSpan()
      Gets the time span of events. @return time span of events
    • getAverageEventRate

      public double getAverageEventRate()
      Gets the average rate of events. @return average rate of events
    • toString

      public String toString()
      Overrides:
      toString in class Object