Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java Sun Feb 28 22:55:33 2010
@@ -43,24 +43,24 @@
* @author Apache Directory Project
* @version $$Rev$$
*/
-public class ApproximateCursor extends AbstractIndexCursor
+public class ApproximateCursor extends AbstractIndexCursor
{
private static final String UNSUPPORTED_MSG = "ApproximateCursors only support positioning by element when a user index exists on the asserted attribute.";
/** An approximate evaluator for candidates */
- private final ApproximateEvaluator approximateEvaluator;
+ private final ApproximateEvaluator approximateEvaluator;
/** Cursor over attribute entry matching filter: set when index present */
- private final IndexCursor userIdxCursor;
+ private final IndexCursor userIdxCursor;
/** NDN Cursor on all entries in (set when no index on user attribute) */
- private final IndexCursor ndnIdxCursor;
+ private final IndexCursor ndnIdxCursor;
/** used only when ndnIdxCursor is used (no index on attribute) */
private boolean available = false;
- public ApproximateCursor( Store db, ApproximateEvaluator approximateEvaluator ) throws Exception
+ public ApproximateCursor( Store db, ApproximateEvaluator approximateEvaluator ) throws Exception
{
this.approximateEvaluator = approximateEvaluator;
@@ -69,7 +69,7 @@
if ( db.hasUserIndexOn( attribute ) )
{
//noinspection unchecked
- Index index = ( Index ) db.getUserIndex( attribute );
+ Index index = ( Index ) db.getUserIndex( attribute );
userIdxCursor = index.forwardCursor( value.get() );
ndnIdxCursor = null;
}
@@ -92,7 +92,7 @@
}
- public void beforeValue( Long id, V value ) throws Exception
+ public void beforeValue( ID id, V value ) throws Exception
{
checkNotClosed( "beforeValue()" );
if ( userIdxCursor != null )
@@ -106,7 +106,7 @@
}
- public void afterValue( Long id, V value ) throws Exception
+ public void afterValue( ID id, V value ) throws Exception
{
checkNotClosed( "afterValue()" );
if ( userIdxCursor != null )
@@ -120,7 +120,7 @@
}
- public void before( IndexEntry element ) throws Exception
+ public void before( IndexEntry element ) throws Exception
{
checkNotClosed( "before()" );
if ( userIdxCursor != null )
@@ -134,7 +134,7 @@
}
- public void after( IndexEntry element ) throws Exception
+ public void after( IndexEntry element ) throws Exception
{
checkNotClosed( "after()" );
if ( userIdxCursor != null )
@@ -202,7 +202,7 @@
while ( ndnIdxCursor.previous() )
{
checkNotClosed( "previous()" );
- IndexEntry, ServerEntry> candidate = ndnIdxCursor.get();
+ IndexEntry, ServerEntry, ID> candidate = ndnIdxCursor.get();
if ( approximateEvaluator.evaluate( candidate ) )
{
return available = true;
@@ -223,7 +223,7 @@
while ( ndnIdxCursor.next() )
{
checkNotClosed( "next()" );
- IndexEntry, ServerEntry> candidate = ndnIdxCursor.get();
+ IndexEntry, ServerEntry, ID> candidate = ndnIdxCursor.get();
if ( approximateEvaluator.evaluate( candidate ) )
{
return available = true;
@@ -235,7 +235,7 @@
@SuppressWarnings("unchecked")
- public IndexEntry get() throws Exception
+ public IndexEntry get() throws Exception
{
checkNotClosed( "get()" );
if ( userIdxCursor != null )
@@ -245,7 +245,7 @@
if ( available )
{
- return ( IndexEntry ) ndnIdxCursor.get();
+ return ( IndexEntry ) ndnIdxCursor.get();
}
throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );
Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java Sun Feb 28 22:55:33 2010
@@ -45,18 +45,18 @@
* @author Apache Directory Project
* @version $Rev$
*/
-public class ApproximateEvaluator implements Evaluator
+public class ApproximateEvaluator implements Evaluator, ServerEntry, ID>
{
- private final ApproximateNode