Code Search for Developers
 
 
  

SimpleReport.java from Tea Stats at Krugle


Show SimpleReport.java syntax highlighted

/*
 * This file is distributed under the GPL v2 as part of teastats site statistics package
 * http://teastats.sourceforge.net
 */
package
        net.time4tea.webstats.report;

import net.time4tea.webstats.statistic.Statistic;
import net.time4tea.webstats.statistic.StatisticMap;
import net.time4tea.webstats.statistic.comparator.ByHitsComparator;
import net.time4tea.webstats.statistic.comparator.ReverseComparator;

import java.io.PrintStream;
import java.util.Formatter;

/**
 * Originally richja Apr 11, 2006
 */
public class SimpleReport {

    PrintStream stream;

    public SimpleReport(PrintStream stream) {
        this.stream = stream;
    }


    public SimpleReport() {
        stream = System.out;
    }

    public void doReport(StatisticMap statisticMap) {

        Formatter formatter = new Formatter(stream);
        String format = "%50s %6d %10d\n";

        stream.println();
        stream.println("-------->");
        stream.println(statisticMap.getName());
        stream.println("-------->");

        for (String key : statisticMap.keys(new ReverseComparator(new ByHitsComparator()))) {
            Statistic counter = statisticMap.get(key);
            formatter.format(format, counter.getKey(), counter.getCount(), counter.getSum());
        }
    }
}




See more files for this project here

Tea Stats

Web log analyzer... Written in OO Perl, provides the usual host / page analysis. Can also do site graphing using graphviz, browser, os, worm and search engine identification, and country and session tracking.

Project homepage: http://sourceforge.net/projects/teastats
Programming language(s): Java
License: other

  FreemarkerTemplate.java
  HTMLIndexReport.java
  HTMLReport.java
  SimpleReport.java