Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11FFC4B5A for ; Tue, 21 Jun 2011 05:21:50 +0000 (UTC) Received: (qmail 14853 invoked by uid 500); 21 Jun 2011 05:21:49 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 14719 invoked by uid 500); 21 Jun 2011 05:21:44 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 14708 invoked by uid 99); 21 Jun 2011 05:21:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 05:21:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 05:21:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AE29523889E0; Tue, 21 Jun 2011 05:21:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1137861 - /directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java Date: Tue, 21 Jun 2011 05:21:18 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110621052118.AE29523889E0@eris.apache.org> Author: elecharny Date: Tue Jun 21 05:21:18 2011 New Revision: 1137861 URL: http://svn.apache.org/viewvc?rev=1137861&view=rev Log: Added some missing Javadoc Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java?rev=1137861&r1=1137860&r2=1137861&view=diff ============================================================================== --- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java (original) +++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java Tue Jun 21 05:21:18 2011 @@ -55,7 +55,7 @@ public class DupsContainerCursor ex /** Tells if we have a tuple to return */ private boolean valueAvailable; - /** */ + /** TODO : do we need this flag ??? */ private Boolean forwardDirection; @@ -112,7 +112,7 @@ public class DupsContainerCursor ex /** * {@inheritDoc} */ - //@SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") public void afterKey( K key ) throws Exception { browser = ((BTree)table.getBTree()).browse( key ); @@ -137,7 +137,7 @@ public class DupsContainerCursor ex browser.getPrevious( jdbmTuple ); // switch in direction bug workaround: when a JDBM browser - // switches direction with next then previous as is occuring + // switches direction with next then previous as is occurring // here then two previous moves are needed. browser.getPrevious( jdbmTuple ); forwardDirection = false; @@ -151,12 +151,18 @@ public class DupsContainerCursor ex } + /** + * {@inheritDoc} + */ public void beforeValue( K key, DupsContainer value ) throws Exception { throw new UnsupportedOperationException( I18n.err( I18n.ERR_573 ) ); } + /** + * {@inheritDoc} + */ public void afterValue( K key, DupsContainer value ) throws Exception { throw new UnsupportedOperationException( I18n.err( I18n.ERR_573 ) ); @@ -175,12 +181,19 @@ public class DupsContainerCursor ex } + /** + * {@inheritDoc} + */ public void after( Tuple> element ) throws Exception { afterKey( element.getKey() ); } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") public void beforeFirst() throws Exception { checkNotClosed( "beforeFirst()" ); @@ -191,6 +204,10 @@ public class DupsContainerCursor ex } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") public void afterLast() throws Exception { checkNotClosed( "afterLast()" ); @@ -201,6 +218,9 @@ public class DupsContainerCursor ex } + /** + * {@inheritDoc} + */ public boolean first() throws Exception { beforeFirst(); @@ -209,17 +229,24 @@ public class DupsContainerCursor ex } + /** + * {@inheritDoc} + */ public boolean last() throws Exception { afterLast(); + return previous(); } - @SuppressWarnings("unchecked") + /** + * {@inheritDoc} + */ public boolean previous() throws Exception { checkNotClosed( "previous()" ); + if ( browser == null ) { afterLast(); @@ -229,12 +256,12 @@ public class DupsContainerCursor ex // only want to set this if the advance is a success which means we // are not at front - if ( forwardDirection == null && advanceSuccess ) + if ( ( forwardDirection == null ) && advanceSuccess ) { forwardDirection = false; } - if ( forwardDirection != null && forwardDirection ) + if ( ( forwardDirection != null ) && forwardDirection ) { advanceSuccess = browser.getPrevious( jdbmTuple ); forwardDirection = false; @@ -244,11 +271,13 @@ public class DupsContainerCursor ex { returnedTuple.setKey( ( K ) jdbmTuple.getKey() ); returnedTuple.setValue( table.getDupsContainer( ( byte[] ) jdbmTuple.getValue() ) ); + return valueAvailable = true; } else { clearValue(); + return false; } } @@ -306,6 +335,9 @@ public class DupsContainerCursor ex } + /** + * {@inheritDoc} + */ public Tuple> get() throws Exception { checkNotClosed( "get()" );