public abstract class AbstractAlgorithm<C extends TimeBasedChargeable> extends Object implements BillingModel.Algorithm<C>
| Constructor and Description |
|---|
AbstractAlgorithm() |
| Modifier and Type | Method and Description |
|---|---|
List<Bill.Detail> |
calc(List<Period> periodList,
C chargeable) |
protected abstract Bill.Detail |
calc(Period period,
long duration,
C chargeable) |
protected TimeUnit |
getTimeUnit() |
protected boolean |
isDiscontinuityAllowed() |
public List<Bill.Detail> calc(List<Period> periodList, C chargeable)
calc in interface BillingModel.Algorithm<C extends TimeBasedChargeable>periodList - 计费的周期protected boolean isDiscontinuityAllowed()
protected TimeUnit getTimeUnit()
protected abstract Bill.Detail calc(Period period, long duration, C chargeable)
period - 时间范围duration - 在此时间范围内的累计时长,时长单位见getTimeUnit()chargeable - 计费对象Copyright © 2020. All rights reserved.