// Path: src/main/java/com/github/davidmoten/rtree/Entry.java
// public interface Entry<T, S extends Geometry> extends HasGeometry {
// 
//     T value();
// 
//     @Override
//     S geometry();
// 
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree/Node.java
// 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);
// 
//     /**
//      * Run when a search requests Long.MAX_VALUE results. This is the
//      * no-backpressure fast path.
//      * 
//      * @param criterion
//      *            function that returns true if the geometry is a search match
//      * @param subscriber
//      *            the subscriber to report search findings to
//      */
//     void searchWithoutBackpressure(Func1<? super Geometry, Boolean> criterion,
//             Subscriber<? super Entry<T, S>> subscriber);
// 
//     int count();
// 
//     Context<T, S> context();
// 
// }
// 
// 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();
// }


import java.util.List;
import java.util.Optional;
import com.github.davidmoten.rtree.Entry;
import com.github.davidmoten.rtree.Node;
import com.github.davidmoten.rtree.geometry.Geometry;
package com.github.davidmoten.rtree.internal;



/**
 * Used for tracking deletions through recursive calls.
 * 
 * @param <T>
 *            value type
 * @param <S> geometry type
 */
public final class NodeAndEntries<T, S extends Geometry> {

    private final Optional<? extends Node<T, S>> node;
// Path: src/main/java/com/github/davidmoten/rtree/Entry.java
// public interface Entry<T, S extends Geometry> extends HasGeometry {
// 
//     T value();
// 
//     @Override
//     S geometry();
// 
// }
// 
// Path: src/main/java/com/github/davidmoten/rtree/Node.java
// 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);
// 
//     /**
//      * Run when a search requests Long.MAX_VALUE results. This is the
//      * no-backpressure fast path.
//      * 
//      * @param criterion
//      *            function that returns true if the geometry is a search match
//      * @param subscriber
//      *            the subscriber to report search findings to
//      */
//     void searchWithoutBackpressure(Func1<? super Geometry, Boolean> criterion,
//             Subscriber<? super Entry<T, S>> subscriber);
// 
//     int count();
// 
//     Context<T, S> context();
// 
// }
// 
// 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
import java.util.List;
import java.util.Optional;
import com.github.davidmoten.rtree.Entry;
import com.github.davidmoten.rtree.Node;
import com.github.davidmoten.rtree.geometry.Geometry;

package com.github.davidmoten.rtree.internal;



/**
 * Used for tracking deletions through recursive calls.
 * 
 * @param <T>
 *            value type
 * @param <S> geometry type
 */
public final class NodeAndEntries<T, S extends Geometry> {

    private final Optional<? extends Node<T, S>> node;
    private final List<Entry<T, S>> entries;