org.jvnet.its
Class TrendBuilder<K extends java.lang.Comparable<K>,DS extends org.jfree.data.xy.XYDataset>

java.lang.Object
  extended by org.jvnet.its.TrendBuilder<K,DS>
Direct Known Subclasses:
AgeTrendBuilder, TimelineTrendBuilder

public abstract class TrendBuilder<K extends java.lang.Comparable<K>,DS extends org.jfree.data.xy.XYDataset>
extends java.lang.Object

Builds a "trend" data, which is a function f(x):int defined as a series of intervals:

 f(x) := 0     if x < x0
      := i0   if x ∊ [x0,x1)
      := i1   if x ∊ [x1,x2)
      ...
 

f(x) is intended to be used to count something, and this class is designed to build f(x) by starting from smaller x and recording delta by using #inc(Activity) and #dec(Activity).

x is normally a value of a time related dimension, but more details about x needs to be defined by subtypes.

Author:
Kohsuke Kawaguchi

Constructor Summary
TrendBuilder()
           
 
Method Summary
protected abstract  void add(DS ds, K start, K end, int value, java.lang.String seriesName)
          Lower-level function to add data to the dataset.
 void addTo(DS ds, java.lang.String seriesName)
          Adds this trend to the given data set.
static void completeMissingLinks(java.util.Collection<? extends TrendBuilder> builders)
          Auguments the trend data among each other so that we have data points for all the dates.
static void completeMissingLinks(TrendBuilder... builders)
           
 void dec(org.kohsuke.jnt.JNIssue.Activity a)
           
 int get(K key)
           
protected abstract  K getKey(org.kohsuke.jnt.JNIssue.Activity a)
           
 void inc(org.kohsuke.jnt.JNIssue.Activity a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrendBuilder

public TrendBuilder()
Method Detail

inc

public void inc(org.kohsuke.jnt.JNIssue.Activity a)

getKey

protected abstract K getKey(org.kohsuke.jnt.JNIssue.Activity a)

dec

public void dec(org.kohsuke.jnt.JNIssue.Activity a)

completeMissingLinks

public static void completeMissingLinks(java.util.Collection<? extends TrendBuilder> builders)
Auguments the trend data among each other so that we have data points for all the dates.


completeMissingLinks

public static void completeMissingLinks(TrendBuilder... builders)

get

public int get(K key)

addTo

public void addTo(DS ds,
                  java.lang.String seriesName)
Adds this trend to the given data set.


add

protected abstract void add(DS ds,
                            K start,
                            K end,
                            int value,
                            java.lang.String seriesName)
Lower-level function to add data to the dataset.



Copyright © 2008. All Rights Reserved.