Esempio n. 1
0
  /**
   * @param value
   * @param N
   * @throws DataException
   */
  private void populateValueListAndRowIdList(Object value, int N) throws DataException {
    assert N >= 0;
    int activeCount = N < this.firstPassRowNumberCounter ? N : this.firstPassRowNumberCounter;
    for (int i = 0; i < activeCount; i++) {
      if (valueList.get(i) == null) {
        valueList.set(i, value);
        rowIdList.set(i, Integer.valueOf(firstPassRowNumberCounter));
        break;
      } else {
        Object result = this.doCompare(value, valueList.get(i));

        try {
          // filter in
          if (DataTypeUtil.toBoolean(result).booleanValue() == true) {
            for (int j = activeCount - 1; j > i; j--) {
              valueList.set(j, valueList.get(j - 1));
              rowIdList.set(j, rowIdList.get(j - 1));
            }
            valueList.set(i, value);
            rowIdList.set(i, Integer.valueOf(firstPassRowNumberCounter));
            break;
          }
        } catch (BirtException e) {
          throw DataException.wrap(e);
        }
      }
    }
  }