Package org.zanata.ui.model.statistic

Examples of org.zanata.ui.model.statistic.WordStatistic.decrement()


        WordStatistic stats = versionStatisticCache.get(key);
        if (stats != null) {
            TextFlowDAO textFlowDAO = serviceLocator.getInstance(TextFlowDAO.class);
            HTextFlow textFlow = textFlowDAO.findById(event.getTextFlowId());

            stats.decrement(event.getPreviousState(),
                    textFlow.getWordCount().intValue());
            stats.increment(event.getNewState(),
                    textFlow.getWordCount().intValue());
            versionStatisticCache.put(key, stats);
        }
View Full Code Here


                            event.getDocumentId(), event.getLocaleId());

            int wordCount = textFlowDAO.getWordCount(event.getTextFlowId());

            WordStatistic oldStats = StatisticsUtil.copyWordStatistic(stats);
            oldStats.decrement(event.getNewState(), wordCount);
            oldStats.increment(event.getPreviousState(), wordCount);

            Events.instance().raiseAsynchronousEvent(
                    DocumentStatisticUpdatedEvent.EVENT_NAME,
                    new DocumentStatisticUpdatedEvent(oldStats, stats,
View Full Code Here

            DocumentServiceImpl spyService,
            ContentState oldState, ContentState newState, WordStatistic stats) {

        int wordCount = 10;
        WordStatistic oldStats = StatisticsUtil.copyWordStatistic(stats);
        oldStats.decrement(newState, wordCount);
        oldStats.increment(oldState, wordCount);

        DocumentStatisticUpdatedEvent event =
                new DocumentStatisticUpdatedEvent(oldStats, stats, versionId,
                        docId, localeId, oldState, newState);
View Full Code Here

        ContentState oldState = ContentState.New;
        ContentState newState = ContentState.Translated;

        WordStatistic stats = new WordStatistic(10, 10, 10, 10, 10);
        WordStatistic oldStats = StatisticsUtil.copyWordStatistic(stats);
        oldStats.decrement(newState, wordCount);
        oldStats.increment(oldState, wordCount);

        when(translationStateCache.getDocumentStatistics(docId, localeId)).
                thenReturn(stats);
        when(textFlowDAO.getWordCount(tfId)).thenReturn(wordCount);
View Full Code Here

        if (stats != null) {
            HTextFlow textFlow = getTextFlowDAO().findById(
                    event.getTextFlowId());

            stats.decrement(event.getPreviousState(),
                    textFlow.getWordCount().intValue());
            stats.increment(event.getNewState(),
                    textFlow.getWordCount().intValue());
            documentStatisticCache.put(key, stats);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.