insert method

void insert(
  1. double min,
  2. double max,
  3. Object item
)

Adds an item to the index which is associated with the given interval

@param min the lower bound of the item interval @param max the upper bound of the item interval @param item the item to insert

@throws IllegalStateException if the index has already been queried

Implementation

void insert(double min, double max, Object item) {
  if (root != null)
    throw new StateError("Index cannot be added to once it has been queried");
  leaves.add(new IntervalRTreeLeafNode(min, max, item));
}