Esempio n. 1
0
 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;
 }
Esempio n. 2
0
  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;
  }