Class AnalyticsObserver.AnalyticsData
java.lang.Object
com.university.bookstore.observer.AnalyticsObserver.AnalyticsData
- Enclosing class:
AnalyticsObserver
Comprehensive analytics data container.
- Since:
- 2024-09-15
- Version:
- 3.0
- Author:
- Navid Mohaghegh
-
Constructor Summary
ConstructorsConstructorDescriptionAnalyticsData(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. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the average rate of events.Gets the event statistics map.longGets the time span of events.longGets the timestamp of first event.longGets the timestamp of last event.Gets the material type statistics map.intGets the total number of events.doubleGets the total inventory value.intGets the number of unique materials.toString()
-
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 eventstotalInventoryValue- total value of inventoryuniqueMaterialCount- number of unique materialseventStatistics- map of event type to countmaterialTypeStatistics- map of material type to countfirstEventTime- timestamp of first eventlastEventTime- timestamp of last eventeventTimeSpan- time span of eventsaverageEventRate- 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
-
getMaterialTypeStatistics
-
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
-