private FilterItem copyFilterItem(FilterItem item, Object[] values, NAtomicInteger parameterIndex) { if (item.isCompoundFilter()) { FilterItem[] childItems = item.getChildItems(); FilterItem[] newChildItems = new FilterItem[childItems.Length]; for (int i = 0; i < childItems.Length; i++) { FilterItem childItem = childItems[i]; FilterItem newChildItem = copyFilterItem(childItem, values, parameterIndex); newChildItems[i] = newChildItem; } NList <FilterItem> elements = new NList <FilterItem>(); foreach (FilterItem element in newChildItems) { elements.Add(element); } FilterItem newFilter = new FilterItem(item.getLogicalOperator(), elements); return(newFilter); } else { if (item.getOperand() is QueryParameter) { Object newOperand = values[parameterIndex.getAndIncrement()]; FilterItem newFilter = new FilterItem(item.getSelectItem(), item.getOperator(), newOperand); return(newFilter); } else { return(item); } } } // copyFilterItem()