protected int addLeaf(final Octant octant) { int id; if (!garbageQueue.isEmpty()) { id = garbageQueue.firstInt(); garbageQueue.remove(id); } else { id = length++; ensureArraySize(id); } leaves[id] = octant; leavesCount++; octant.leafId = id; return id; }
protected int addView(final GraphViewImpl view) { checkNonNullViewObject(view); int id; if (!garbageQueue.isEmpty()) { id = garbageQueue.firstInt(); garbageQueue.remove(id); } else { id = length++; ensureArraySize(id); } views[id] = view; view.storeId = id; return id; }