RTree extends SpatialIndex<T> { private LinkedList<T> query( final float[] bbox, NodeEntry<T>[] node ) { LinkedList<T> list = new LinkedList<T>(); for ( NodeEntry<T> e : node ) { if ( e != null && intersects( bbox, e.bbox, 2 ) ) { if ( e.next == null ) { list.add( e.entryValue ); if ( ( list.size() >= bigM * 10 && outputWarning ) ) { outputWarning = false; } } else { list.addAll( query( bbox, e.next ) ); if ( ( list.size() >= bigM * 10 ) && outputWarning ) { outputWarning = false; } } } } return list; } RTree( float[] rootEnvelope, int numberOfObjects ); static RTree<T> loadFromDisk( String storagePath ); @Override LinkedList<T> query( float[] env ); @SuppressWarnings("unchecked") @Override void insertBulk( List<Pair<float[], T>> listOfObjects ); @Override void clear(); @Override boolean remove( T object ); boolean getExtraFlag(); @SuppressWarnings("unchecked") @Override boolean insert( float[] insertBox, T object ); void writeTreeToDisk( String storagePath );  }
@Test public void queryTest() { System.out.println(); System.out.println( "---------------------" ); myQuery( new float[] { 0, 0, 50, 50 }, tree.root ); }