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 1944110DCF for ; Sun, 24 Nov 2013 08:34:46 +0000 (UTC) Received: (qmail 68889 invoked by uid 500); 24 Nov 2013 08:34:44 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 68830 invoked by uid 500); 24 Nov 2013 08:34:43 -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 68823 invoked by uid 99); 24 Nov 2013 08:34:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Nov 2013 08:34:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_BEFORE 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; Sun, 24 Nov 2013 08:34:40 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B8E0223889CB; Sun, 24 Nov 2013 08:34:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1544939 - in /directory/site/trunk/content/mavibot/user-guide: 4-btree-operations.mdtext images/ug-btree-has-next.graphml images/ug-btree-has-next.png Date: Sun, 24 Nov 2013 08:34:19 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131124083419.B8E0223889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Sun Nov 24 08:34:19 2013 New Revision: 1544939 URL: http://svn.apache.org/r1544939 Log: Added doco about hasNext method Added: directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.graphml directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.png (with props) Modified: directory/site/trunk/content/mavibot/user-guide/4-btree-operations.mdtext Modified: directory/site/trunk/content/mavibot/user-guide/4-btree-operations.mdtext URL: http://svn.apache.org/viewvc/directory/site/trunk/content/mavibot/user-guide/4-btree-operations.mdtext?rev=1544939&r1=1544938&r2=1544939&view=diff ============================================================================== --- directory/site/trunk/content/mavibot/user-guide/4-btree-operations.mdtext (original) +++ directory/site/trunk/content/mavibot/user-guide/4-btree-operations.mdtext Sun Nov 24 08:34:19 2013 @@ -41,7 +41,7 @@ Here is the **BTree** sample we will use ### 4.1.1 Cursor position management -#### 4.1.1.1 afterLast() +#### 4.1.1.1 afterLast Moves the current position after the last element (last key and last value). The following schema shows the new position of the pointer after having called the _afterLast()_ method : @@ -50,7 +50,7 @@ Moves the current position after the las As we can see, we are not pointing any tuple nor any key. -#### 4.1.1.2 beforeFirst() +#### 4.1.1.2 beforeFirst Moves the current position before the first element (first key and first value). The following schema shows the new position of the pointer after having called the _beforeFirst()_ method : @@ -60,20 +60,42 @@ As we can see, we are not pointing any t ### 4.1.2 Cursor operations -We have to sets of methods depending on the elements we are browsing : tuples or keys. +We have to sets of methods depending on the elements we are browsing : tuples or keys. Operations on tuples may return many tuples with the same key (actually, one per value), when operations on keys just return one tuple containing the key and the first value for this key. -#### 4.1.2.1 Browsing tuples +#### 4.1.2.1 hasNext -* hasNext() : tells if there is a next available tuple -* hasPrev() : tells if there is a previous available tuple -* next() : move to the next value, or to the next key if all the values have been processed, and return the associated tuple -* prev() : move to the previous value, or to the next key if all the values have been processed, and return the associated tuple - -#### 4.1.2.1 Browsing keys -* hasNextKey() : tells if there is a next available key -* hasPrevKey() : tells if there is a previous available key -* nextKey() : move to the next key, even if we have more values to process -* prevKey() : move to the previous key, even if we have more values to process +Tells if there is a next available tuple. This will always be true if we are before the first tuple, and always be fore if we are on the last tuple or after the last tuple. The following picture shows the returned value for calls in various cases : + +![Has Next](images/ug-btree-has-next.png) + + +#### 4.1.2.2 hasPrev + +Tells if there is a previous available tuple + +#### 4.1.2.3 next + +Moves to the next value, or to the next key if all the values have been processed, and return the associated tuple + +#### 4.1.2.4 prev + +Moves to the previous value, or to the next key if all the values have been processed, and return the associated tuple + +#### 4.1.2.5 hasNextKey + +Tells if there is a next available key + +#### 4.1.2.6 hasPrevKey + +Tells if there is a previous available key + +#### 4.1.2.7 nextKey + +Moves to the next key, even if we have more values to process + +#### 4.1.2.8 prevKey + +Moves to the previous key, even if we have more values to process ## 4.1 Browse Operations Added: directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.graphml URL: http://svn.apache.org/viewvc/directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.graphml?rev=1544939&view=auto ============================================================================== --- directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.graphml (added) +++ directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.graphml Sun Nov 24 08:34:19 2013 @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + + + + + + + + + + before + + + + + + + + + + + + + + + + <A, vA1> + + + + + + + + + + + + + + + + + hasNext : TRUE + + + + + + + + + + + + + + + + + Tuple Cursor + + + + + + + + + + + + + + + + + + + <A, vA2> + + + + + + + + + + + + + + + + <A, vA3> + + + + + + + + + + + + + + + + <A, vA4> + + + + + + + + + + + + + + + + <B, vB> + + + + + + + + + + + + + + + + <C, vC1> + + + + + + + + + + + + + + + + <C, vC2> + + + + + + + + + + + + + + + + <D, vD> + + + + + + + + + + + + + + + + <E, vE> + + + + + + + + + + + + + + + + <F, vF> + + + + + + + + + + + + + + + + <G, vG1> + + + + + + + + + + + + + + + + <G, vG2> + + + + + + + + + + + + + + + + after + + + + + + + + + + + + + + + + + hasNext : TRUE + + + + + + + + + + + + + + + + + hasNext : FALSE + + + + + + + + + + + + + + + + + hasNext : FALSE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.png URL: http://svn.apache.org/viewvc/directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.png?rev=1544939&view=auto ============================================================================== Binary file - no diff available. Propchange: directory/site/trunk/content/mavibot/user-guide/images/ug-btree-has-next.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream