Update stats.

@param event the event
320887
private void updateStats(ContentEvent event) {
        Instance instance;
        if (event instanceof ClusteringContentEvent){
            //Local Clustering
            ClusteringContentEvent ev = (ClusteringContentEvent) event;
            instance = ev.getInstance();
            DataPoint point = new DataPoint(instance, Integer.parseInt(event.getKey()));
            model.trainOnInstance(point);
            instancesCount++;
        }
        
        if (event instanceof ClusteringResultContentEvent){
            //Global Clustering
            ClusteringResultContentEvent ev = (ClusteringResultContentEvent) event;
            Clustering clustering = ev.getClustering(); 
            
            for (int i=0; i<clustering.size(); i++) { 
                instance = new DenseInstance(1.0,clustering.get(i).getCenter());
                instance.setDataset(model.getDataset());
                DataPoint point = new DataPoint(instance, Integer.parseInt(event.getKey()));
                model.trainOnInstance(point);
                instancesCount++;
            }
        }    

        if (instancesCount % this.sampleFrequency == 0) {
            logger.info("Trained model using {} events with classifier id {}", instancesCount, this.modelId); // getId());
        }
    }
1181888
public void update(TestCaseStartedEvent event) {
        if (isTitleAnnotationPresent()) {
            event.setTitle(getTitle());
        }

        if (isDescriptionAnnotationPresent()) {
            event.setDescription(getDescription());
        }

        if (isSeverityAnnotationPresent()) {
            event.getLabels().add(createSeverityLabel(getSeverity()));
        }

        if (isIssueAnnotationPresent()) {
            event.getLabels().add(createIssueLabel(getIssueKey()));
        }

        if (isIssuesAnnotationPresent()) {
            for (String issueKey : getIssueKeys()) {
                event.getLabels().add(createIssueLabel(issueKey));
            }
        }

        if (isTestCaseIdAnnotationPresent()) {
            event.getLabels().add(createTestLabel(getTestCaseId()));
        }

        event.getLabels().addAll(getStoryLabels());
        event.getLabels().addAll(getFeatureLabels());
        withExecutorInfo(event);
    }
49479
protected void notifyListeners (int event)
    {
        int size = _listeners.size();
        for (int ii = 0; ii < size; ii++) {
            _listeners.get(ii).modelChanged(event);
        }
    }
1324561
@SuppressWarnings("unchecked")
   @CacheEntryModified
   public void cacheEntryModified(CacheEntryModifiedEvent<Serializable, Object> event)
   {
      if (!event.isPre() && event.getKey().equals(namesKey))
      {
         Set<String> set = (Set<String>)event.getValue();
         if (set != null)
         {
            refreshIndexes(set);
         }
      }
   }
34792
protected void update(DocumentEvent event)
	{
		String text;
		try
		{
			text = event.getDocument().getText(event.getDocument().getStartPosition().getOffset(),
				event.getDocument().getEndPosition().getOffset() - 1);
			model.setObject(text);
		}
		catch (BadLocationException e1)
		{
			log.log(Level.SEVERE,
				"some portion of the given range was not a valid part of the document. "
					+ "The location in the exception is the first bad position encountered.",
				e1);
		}
	}
286648
public void update(MsNotifyEvent event) {
		logger.info("resource updated : event FQN " + event.getEventID().getFqn());
		if(session != null && link != null && event.getEventID().equals(MsAnnouncement.COMPLETED)) {						
			try {
				SipServletRequest byeRequest = session.createRequest("BYE");				
				byeRequest.send();																	
			} catch (IOException e) {
				logger.error("Unexpected error while sending the BYE request", e);				
			}
			link.release();			
		}
	}
260916
public void updateDatum (Object element, int row)
    {
        _data.set(row, element);
        _model.fireTableRowsUpdated(row, row);
    }
600513
private void onUpdate(EventLog log)
    {
        if (updateEvents == null)
        {
            updateEvents = new ConcurrentHashMap<Object, EventLog>();

        }

        updateEvents.put(log.getEntityId(), log);
    }
433461
public void add(TimelineEvent event, TimelineUpdater timelineUpdater) {
        events.add(event);

        if (timelineUpdater != null) {
            // update UI
            timelineUpdater.add(event);
        }
    }
1211049
public void updateStringModel(AjaxBehaviorEvent event) {
        stringModel.setValue(stringModel.getValue() + createUpdateString());
        eduContext.update("string-model-changed");
    }
151030
private void onMessageRead(MessageReadEvent event) {
        handler.post(() -> listener.onMessageRead(event));
        log("Event published " + event.toString());
    }
202975
public function onUpdate(EventInterface $event)
    {
        $values = $event->getParam('values');

        $now = new DateTime();
        $values['last_updated_at'] = $now->format('Y-m-d h:i:s');

        $event->setParam('values', $values);
    }
227987
public void time(Runnable event) {
        long startTime = this.clock.getTick();
        try {
            event.run();
        } finally {
            update(this.clock.getTick() - startTime);
        }
    }
1269251
public void update(List<UninstallationProgressEvent> events) {
        if (!isVisible()) {
            if ((System.currentTimeMillis() - startTime) >= MS_TO_WAIT_BEFORE_SHOW) {
                if (!done && !setVisibleInvoked) {
                    setVisibleInvoked = true;
                    EventQueue.invokeLater(new Runnable() {

                        @Override
                        public void run() {
                            if (!done) {
                                UninstallationProgressDialogue.super.setVisible(true);
                            }
                        }
                    });
                }
            }
        }

        int totalAmount = 0;
        AddOn addOn = null;

        for (UninstallationProgressEvent event : events) {
            totalAmount += event.getAmount();
            if (UninstallationProgressEvent.Type.FINISHED_ADD_ON == event.getType()) {
                for (AddOnUninstallListener listener : listeners) {
                    failedUninstallations = !event.isUninstalled();
                    listener.addOnUninstalled(currentAddOn, update, event.isUninstalled());
                }
            } else if (UninstallationProgressEvent.Type.ADD_ON == event.getType()) {
                addOn = event.getAddOn();
                currentAddOn = addOn;
                update = event.isUpdate();

                for (AddOnUninstallListener listener : listeners) {
                    listener.uninstallingAddOn(addOn, update);
                }
            }
        }

        UninstallationProgressEvent last = events.get(events.size() - 1);

        if (addOn != null) {
            setCurrentAddOn(addOn);
        }

        if (totalAmount != 0) {
            incrementProgress(totalAmount);
        }

        if (currentType != last.getType()) {
            String keyMessage;
            switch (last.getType()) {
            case FILE:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingFile";
                break;
            case ACTIVE_RULE:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingActiveScanner";
                break;
            case PASSIVE_RULE:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingPassiveScanner";
                break;
            case EXTENSION:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingExtension";
                break;
            default:
                keyMessage = "";
                break;
            }
            currentType = last.getType();
            keyBaseStatusMessage = keyMessage;
        }

        if (keyBaseStatusMessage.isEmpty()) {
            setCustomMessage("");
        } else {
            setCustomMessage(
                    Constant.messages
                            .getString(keyBaseStatusMessage, last.getValue(), last.getMax()));
        }
    }
329020
public void dispatch(Event<?> event) {
		//eventManagement.dispatch(event);
		for (EventListener listener : KReflection.Holder.INSTANCE.listeners) {
			try {
				listener.handleEvent(event);
			} catch (Exception e) {
				// ignore
				// TODO add message kind
			}
		}
	}
498525
private void updateRuntimeStatus() {

    final RuntimeStatusEventImpl.Builder builder = RuntimeStatusEventImpl.newBuilder()
        .setName(RUNTIME_NAME)
        .setState(State.RUNNING)
        .setOutstandingContainerRequests(this.containerRequestCounter.get());

    for (final String allocatedContainerId : this.containers.getContainerIds()) {
      builder.addContainerAllocation(allocatedContainerId);
    }

    this.reefEventHandlers.onRuntimeStatus(builder.build());
  }
108702
public void update(TestSuiteStartedEvent event) {
        if (isTitleAnnotationPresent()) {
            event.setTitle(getTitle());
        }

        if (isDescriptionAnnotationPresent()) {
            event.setDescription(getDescription());
        }

        if (isIssueAnnotationPresent()) {
            event.getLabels().add(createIssueLabel(getIssueKey()));
        }

        if (isIssuesAnnotationPresent()) {
            for (String issueKey : getIssueKeys()) {
                event.getLabels().add(createIssueLabel(issueKey));
            }
        }

        event.getLabels().addAll(getStoryLabels());
        event.getLabels().addAll(getFeatureLabels());
    }