// Path: src/main/java/com/github/davidmoten/rtree/geometry/Geometry.java
// public interface Geometry {
// 
//     /**
//      * <p>
//      * Returns the distance to the given {@link Rectangle}. For a {@link Rectangle}
//      * this might be Euclidean distance but for an EPSG4326 lat-long Rectangle might
//      * be great-circle distance. The distance function should satisfy the following
//      * properties:
//      * </p>
//      * 
//      * <p>
//      * <code>distance(r) &gt;= 0</code>
//      * </p>
//      * 
//      * <p>
//      * <code>if r1 contains r2 then distance(r1)&lt;=distance(r2)</code>
//      * </p>
//      * 
//      * 
//      * @param r
//      *            rectangle to measure distance to
//      * @return distance to the rectangle r from the geometry
//      */
//     double distance(Rectangle r);
// 
//     /**
//      * Returns the minimum bounding rectangle of this geometry.
//      * 
//      * @return minimum bounding rectangle
//      */
//     Rectangle mbr();
// 
//     boolean intersects(Rectangle r);
// 
//     boolean isDoublePrecision();
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree/internal/NodeAndEntries.java
// public final class NodeAndEntries<T, S extends Geometry> {
// 
//     private final Optional<? extends Node<T, S>> node;
//     private final List<Entry<T, S>> entries;
//     private final int count;
// 
//     /**
//      * Constructor.
//      * 
//      * @param node
//      *            absent = whole node was deleted present = either an unchanged
//      *            node because of no removal or the newly created node without
//      *            the deleted entry
//      * @param entries
//      *            from nodes that dropped below minChildren in size and thus
//      *            their entries are to be redistributed (readded to the tree)
//      * @param countDeleted
//      *            count of the number of entries removed
//      */
//     public NodeAndEntries(Optional<? extends Node<T, S>> node, List<Entry<T, S>> entries,
//             int countDeleted) {
//         this.node = node;
//         this.entries = entries;
//         this.count = countDeleted;
//     }
// 
//     public Optional<? extends Node<T, S>> node() {
//         return node;
//     }
// 
//     public List<Entry<T, S>> entriesToAdd() {
//         return entries;
//     }
// 
//     public int countDeleted() {
//         return count;
//     }
// 
// }


import java.util.List;
import com.github.davidmoten.rtree.geometry.Geometry;
import com.github.davidmoten.rtree.geometry.HasGeometry;
import com.github.davidmoten.rtree.internal.NodeAndEntries;
import rx.Subscriber;
import rx.functions.Func1;
package com.github.davidmoten.rtree;




public interface Node<T, S extends Geometry> extends HasGeometry {

    List<Node<T, S>> add(Entry<? extends T, ? extends S> entry);

// Path: src/main/java/com/github/davidmoten/rtree/geometry/Geometry.java
// public interface Geometry {
// 
//     /**
//      * <p>
//      * Returns the distance to the given {@link Rectangle}. For a {@link Rectangle}
//      * this might be Euclidean distance but for an EPSG4326 lat-long Rectangle might
//      * be great-circle distance. The distance function should satisfy the following
//      * properties:
//      * </p>
//      * 
//      * <p>
//      * <code>distance(r) &gt;= 0</code>
//      * </p>
//      * 
//      * <p>
//      * <code>if r1 contains r2 then distance(r1)&lt;=distance(r2)</code>
//      * </p>
//      * 
//      * 
//      * @param r
//      *            rectangle to measure distance to
//      * @return distance to the rectangle r from the geometry
//      */
//     double distance(Rectangle r);
// 
//     /**
//      * Returns the minimum bounding rectangle of this geometry.
//      * 
//      * @return minimum bounding rectangle
//      */
//     Rectangle mbr();
// 
//     boolean intersects(Rectangle r);
// 
//     boolean isDoublePrecision();
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree/internal/NodeAndEntries.java
// public final class NodeAndEntries<T, S extends Geometry> {
// 
//     private final Optional<? extends Node<T, S>> node;
//     private final List<Entry<T, S>> entries;
//     private final int count;
// 
//     /**
//      * Constructor.
//      * 
//      * @param node
//      *            absent = whole node was deleted present = either an unchanged
//      *            node because of no removal or the newly created node without
//      *            the deleted entry
//      * @param entries
//      *            from nodes that dropped below minChildren in size and thus
//      *            their entries are to be redistributed (readded to the tree)
//      * @param countDeleted
//      *            count of the number of entries removed
//      */
//     public NodeAndEntries(Optional<? extends Node<T, S>> node, List<Entry<T, S>> entries,
//             int countDeleted) {
//         this.node = node;
//         this.entries = entries;
//         this.count = countDeleted;
//     }
// 
//     public Optional<? extends Node<T, S>> node() {
//         return node;
//     }
// 
//     public List<Entry<T, S>> entriesToAdd() {
//         return entries;
//     }
// 
//     public int countDeleted() {
//         return count;
//     }
// 
// }


// Path: src/main/java/com/github/davidmoten/rtree/Node.java
import java.util.List;
import com.github.davidmoten.rtree.geometry.Geometry;
import com.github.davidmoten.rtree.geometry.HasGeometry;
import com.github.davidmoten.rtree.internal.NodeAndEntries;
import rx.Subscriber;
import rx.functions.Func1;

package com.github.davidmoten.rtree;




public interface Node<T, S extends Geometry> extends HasGeometry {

    List<Node<T, S>> add(Entry<? extends T, ? extends S> entry);

    NodeAndEntries<T, S> delete(Entry<? extends T, ? extends S> entry, boolean all);