ibspan.tss.um.statistics
Class TmpStatisticsMap

java.lang.Object
  extended by ibspan.tss.um.statistics.TmpStatisticsMap

public class TmpStatisticsMap
extends Object

The structure containing up-to-date statistics about number of user behaviours according to their type and objected concept. Each time, new events come, statistics should be updated by update() method.

Author:
Maciej Gawinecki

Constructor Summary
TmpStatisticsMap()
           
 
Method Summary
 OntModel exportStatistics(OntModel model)
          Exports data from temporary statistics map into model.
 int get(TmpStatisticsKey key)
          Returns the number of events matching the key.
static TmpStatisticsMap importStatistics(OntModel model)
          Import statistics from the given model into map, where count is number of occurences of event described by Key.
 void update(List<ExtendedEvent> events)
          Updates statistics with given events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TmpStatisticsMap

public TmpStatisticsMap()
Method Detail

importStatistics

public static TmpStatisticsMap importStatistics(OntModel model)
                                         throws com.ibm.adtech.jastor.JastorException
Import statistics from the given model into map, where count is number of occurences of event described by Key.

Parameters:
model - statistics model
Returns:
mapped statistics model
Throws:
com.ibm.adtech.jastor.JastorException

exportStatistics

public OntModel exportStatistics(OntModel model)
                          throws com.ibm.adtech.jastor.JastorException
Exports data from temporary statistics map into model. TODO: this method is not efficient, since it should export only statistics which were updated.

Parameters:
model - to model where statistics will be stored
Throws:
com.ibm.adtech.jastor.JastorException

get

public int get(TmpStatisticsKey key)
Returns the number of events matching the key. Matching is perfomed only against those fields of the key which are not equal to null.

Parameters:
key - key for filtering
Returns:
number of events

update

public void update(List<ExtendedEvent> events)
Updates statistics with given events.

Parameters:
events - list of events