nearest method

V nearest (V object, { TreeSearch nearestOption: TreeSearch.NEAREST })
override

Search the tree for the matching object or the nearestOption if missing. See TreeSearch.

Implementation

V nearest(V object, {TreeSearch nearestOption: TreeSearch.NEAREST}) {
  AvlNode<V> found = _searchNearest(object, option: nearestOption);
  return (found != null) ? found.object : null;
}