|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.stat.FrequencyCounter
public abstract class FrequencyCounter
频次计数器的基类,它实现了一些公共的方法,并留出具体实现方法给子类去实现。
| Constructor Summary | |
|---|---|
FrequencyCounter()
|
|
| Method Summary | |
|---|---|
void |
count()
记录在当前时间发生了一次 |
void |
count(Date when)
记录在某个时间发生了一次 |
void |
count(Date when,
int times)
记录在某个时间发生了几次 |
void |
count(int times)
记录在当前时间发生了几次 |
void |
count(long when)
记录在某个时间发生了一次 |
abstract void |
count(long when,
int times)
记录在某时刻发生了多少次 |
long |
getCount(Date when)
获得某个时间的计数 |
long |
getCount(Date fromWhen,
Date toWhen)
获得某时间区间的计数 |
long |
getCount(Date fromWhen,
Date toWhen,
boolean fromInclusive,
boolean toInclusive)
获得某时间区间的计数 |
long |
getCount(Date toWhen,
long period,
TimeUnit unit)
获得某时间区间的计数 |
abstract long |
getCount(long when)
获得某时刻的统计数 |
long |
getCount(long fromWhen,
long toWhen)
获得某时间区间的计数 |
abstract long |
getCount(long fromWhen,
long toWhen,
boolean fromInclusive,
boolean toInclusive)
获得在某时段内的总统计数 |
long |
getCount(long toWhen,
long period,
TimeUnit unit)
获得某时间区间的计数 |
long |
getCount(long period,
TimeUnit unit)
获得最近一段时间的计数 |
void |
purge(Date tillWhen)
删除掉早于一定时间的记录 |
void |
purge(Date baseTime,
long periodBefore,
TimeUnit unit)
删除掉早于一定时间的记录 |
abstract void |
purge(long tillWhen)
清除过旧的历史数据 |
void |
purge(long baseTime,
long periodBefore,
TimeUnit unit)
删除掉早于一定时间的记录 |
void |
purge(long periodBefore,
TimeUnit unit)
删除掉早于一定时间的记录 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FrequencyCounter()
| Method Detail |
|---|
public abstract void count(long when,
int times)
when - 发生的时刻times - 发生的次数public abstract long getCount(long when)
when - 时刻
public abstract long getCount(long fromWhen,
long toWhen,
boolean fromInclusive,
boolean toInclusive)
fromWhen - 开始时间toWhen - 结束时间fromInclusive - 是否包含开始时间toInclusive - 是否包含结束时间
public abstract void purge(long tillWhen)
tillWhen - 清除到哪个时间点为止
public void count(Date when,
int times)
when - 发生时间times - 发生次数public void count(long when)
when - 发生的时间public void count()
public void count(int times)
times - 发生的次数public void count(Date when)
when - 发生的时间public long getCount(Date when)
when - 时刻
public long getCount(long fromWhen,
long toWhen)
fromWhen - 开始时间toWhen - 结束时间
public long getCount(Date fromWhen,
Date toWhen,
boolean fromInclusive,
boolean toInclusive)
fromWhen - 开始时间toWhen - 结束时间fromInclusive - 是否包含开始时间toInclusive - 是否包含结束时间
public long getCount(Date fromWhen,
Date toWhen)
fromWhen - 开始时间toWhen - 结束时间
public long getCount(long toWhen,
long period,
TimeUnit unit)
toWhen - 到某个时间为止period - 向前推多少时间unit - 向前推多少时间的单位
public long getCount(Date toWhen,
long period,
TimeUnit unit)
toWhen - 到某个时间为止period - 向前推多少时间unit - 向前推多少时间的单位
public long getCount(long period,
TimeUnit unit)
period - 向前推多少时间unit - 向前推多少时间的单位
public void purge(Date tillWhen)
tillWhen - 清除到哪个时间点为止
public void purge(long baseTime,
long periodBefore,
TimeUnit unit)
baseTime - 从什么时间算起periodBefore - 多少时间之前的要删掉unit - 时间单位
public void purge(Date baseTime,
long periodBefore,
TimeUnit unit)
baseTime - 从什么时间算起periodBefore - 多少时间之前的要删掉unit - 时间单位
public void purge(long periodBefore,
TimeUnit unit)
periodBefore - 从现在算起,多少时间之前unit - 时间单位
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||