类 AbstractAlgorithm<C extends TimeBasedChargeable>

java.lang.Object
org.coodex.billing.timebased.reference.AbstractAlgorithm<C>
所有已实现的接口:
BillingModel.Algorithm<C>

public abstract class AbstractAlgorithm<C extends TimeBasedChargeable> extends Object implements BillingModel.Algorithm<C>
  • 构造器详细资料

    • AbstractAlgorithm

      public AbstractAlgorithm()
  • 方法详细资料

    • calc

      public List<Bill.Detail> calc(List<Period> periodList, C chargeable)
      指定者:
      calc 在接口中 BillingModel.Algorithm<C extends TimeBasedChargeable>
      参数:
      periodList - 计费的周期
      返回:
      为空或者为0则表示不适用
    • isDiscontinuityAllowed

      protected boolean isDiscontinuityAllowed()
      返回:
      是否允许不连续
    • getTimeUnit

      protected TimeUnit getTimeUnit()
      返回:
      计算时使用的时间单位,默认为分钟
    • calc

      protected abstract Bill.Detail calc(Period period, long duration, C chargeable)
      参数:
      period - 时间范围
      duration - 在此时间范围内的累计时长,时长单位见getTimeUnit()
      chargeable - 计费对象
      返回:
      计费明细