Exemplo n.º 1
0
  @Override
  public void addValue(int inputId, Value value) {
    final Object input = getInput(value);

    if (input == null) {
      attachFileSetForNewValue(value, inputId);
    } else if (input instanceof Integer) {
      ChangeBufferingList list = new ChangeBufferingList();
      list.add(((Integer) input).intValue());
      list.add(inputId);
      resetFileSetForValue(value, list);
    } else {
      ((ChangeBufferingList) input).add(inputId);
    }
  }
Exemplo n.º 2
0
  private void ensureFileSetCapacityForValue(Value value, int count) {
    if (count <= 1) return;
    Object input = getInput(value);

    if (input != null) {
      if (input instanceof Integer) {
        ChangeBufferingList list = new ChangeBufferingList(count + 1);
        list.add(((Integer) input).intValue());
        resetFileSetForValue(value, list);
      } else if (input instanceof ChangeBufferingList) {
        ChangeBufferingList list = (ChangeBufferingList) input;
        list.ensureCapacity(count);
      }
      return;
    }

    final Object fileSet = new ChangeBufferingList(count);
    attachFileSetForNewValue(value, fileSet);
  }