TreeItem parentItem = item.parentItem; int [] ids = parentItem == null ? childIds : parentItem.childIds; int index = -1; for (int i = 0; i < ids.length; i++) { if (ids [i] == id) { index = i; break; } } if (index != -1) { System.arraycopy(ids, 0, ids, 0, index); System.arraycopy(ids, index+1, ids, index, ids.length - index - 1); ids [ids.length -1] = 0; } if (parentItem != null) { parentItem.itemCount--; if (parentItem.itemCount == 0) parentItem.childIds = null; }
void releaseItem (TreeItem item, boolean release) {	int id = item.id;	if (release) item.release (false);	items [id - 1] = null;}