Beispiel #1
0
  @Override
  public Collection<DataElementOperand> filterOperands(
      final Collection<DataElementOperand> operands, final PeriodType periodType) {
    final Collection<DataElementOperand> filteredOperands = new HashSet<>();

    for (final DataElementOperand operand : operands) {
      if (operand.getValueType().equals(VALUE_TYPE_INT)
          && operand.getAggregationOperator().equals(AGGREGATION_OPERATOR_SUM)
          && operand.getFrequencyOrder() <= periodType.getFrequencyOrder()) // Ignore disaggregation
      {
        filteredOperands.add(operand);
      }
    }

    return filteredOperands;
  }
  /**
   * Return the potential number of periods of the given period type which is spanned by this
   * period.
   *
   * @param type the period type.
   * @return the potential number of periods of the given period type spanned by this period.
   */
  public int getPeriodSpan(PeriodType type) {
    double no = (double) this.getFrequencyOrder() / type.getFrequencyOrder();

    return (int) Math.floor(no);
  }