View Javadoc
1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License.
18   *
19   */
20  package org.apache.directory.mavibot.btree;
21  
22  
23  import java.util.List;
24  
25  
26  /**
27   * The result of a delete operation, when the child has not been merged. It contains the
28   * reference to the modified page, and the removed element.
29   * 
30   * @param <K> The type for the Key
31   * @param <V> The type for the stored value
32   *
33   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34   */
35  /* No qualifier*/class MergedWithSiblingResult<K, V> extends AbstractDeleteResult<K, V>
36  {
37      /**
38       * The default constructor for RemoveResult.
39       * 
40       * @param modifiedPage The modified page
41       * @param removedElement The removed element (can be null if the key wasn't present in the tree)
42       */
43      public MergedWithSiblingResult( Page<K, V> modifiedPage, Tuple<K, V> removedElement )
44      {
45          super( modifiedPage, removedElement );
46      }
47  
48  
49      /**
50       * A constructor for RemoveResult which takes a list of copied page.
51       * 
52       * @param copiedPages the list of copied pages
53       * @param modifiedPage The modified page
54       * @param removedElement The removed element (can be null if the key wasn't present in the tree)
55       */
56      public MergedWithSiblingResult( List<Page<K, V>> copiedPages, Page<K, V> modifiedPage,
57          Tuple<K, V> removedElement )
58      {
59          super( copiedPages, modifiedPage, removedElement );
60      }
61  
62  
63      /**
64       * @see Object#toString()
65       */
66      public String toString()
67      {
68          StringBuilder sb = new StringBuilder();
69  
70          sb.append( "MergedWithSiblingResult" );
71          sb.append( "\n    removed element : " ).append( getRemovedElement() );
72          sb.append( "\n    modifiedPage : " ).append( getModifiedPage() );
73  
74          return sb.toString();
75      }
76  }