View Javadoc

1   /*
2    *   Copyright 2004 The Apache Software Foundation
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   *
16   */
17  package org.apache.ldap.server.partition.impl.btree;
18  
19  
20  /***
21   * A key/value tuple for simple two column Tables.  Implemented to provide 
22   * independence from the Jdbm Tuple class.  Key and value copying should be 
23   * performed to transpose jdbm.helper.Tuple data into our generic Tuple.
24   * 
25   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
26   * @version $Rev: 264732 $
27   */
28  public class Tuple
29  {
30      /*** the key for this Tuple */
31      private Object key;
32      /*** the value for this Tuple */
33      private Object value;
34  
35      
36      /***
37       * Do nothing default that has a null key and null value.
38       */
39      public Tuple()
40      {
41          // does nothing!
42      }
43      
44  
45      /***
46       * Creates a Tuple using a key and a value.
47       * 
48       * @param key the key to set
49       * @param value the value to set
50       */    
51      public Tuple( Object key, Object value )
52      {
53          this.key = key;
54          this.value = value;
55      }
56      
57      
58      /***
59       * Gets the key for this Tuple.
60       *
61       * @return the Tuple's key
62       */
63      public Object getKey()
64      {
65          return key;
66      }
67      
68      
69      /***
70       * Sets the key for this Tuple.
71       *
72       * @param key the new key to set
73       */
74      public void setKey( Object key )
75      {
76          this.key = key;
77      }
78      
79      
80      /***
81       * Gets the value for this Tuple.
82       *
83       * @return the Tuple's value
84       */
85      public Object getValue()
86      {
87          return value;
88      }
89      
90      
91      /***
92       * Sets the value for this Tuple.
93       *
94       * @param value the new value to set
95       */
96      public void setValue( Object value )
97      {
98          this.value = value;
99      }
100 }