KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > collections > keyvalue > DefaultMapEntry


1 /*
2  * Copyright 2001-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 package org.apache.commons.collections.keyvalue;
17
18 import java.util.Map JavaDoc;
19
20 import org.apache.commons.collections.KeyValue;
21
22 /**
23  * A restricted implementation of {@link java.util.Map.Entry} that prevents
24  * the MapEntry contract from being broken.
25  *
26  * @since Commons Collections 3.0
27  * @version $Revision: 1.3 $ $Date: 2004/02/18 01:00:08 $
28  *
29  * @author James Strachan
30  * @author Michael A. Smith
31  * @author Neil O'Toole
32  * @author Stephen Colebourne
33  */

34 public final class DefaultMapEntry extends AbstractMapEntry {
35     
36     /**
37      * Constructs a new entry with the specified key and given value.
38      *
39      * @param key the key for the entry, may be null
40      * @param value the value for the entry, may be null
41      */

42     public DefaultMapEntry(final Object JavaDoc key, final Object JavaDoc value) {
43         super(key, value);
44     }
45
46     /**
47      * Constructs a new entry from the specified KeyValue.
48      *
49      * @param pair the pair to copy, must not be null
50      * @throws NullPointerException if the entry is null
51      */

52     public DefaultMapEntry(final KeyValue pair) {
53         super(pair.getKey(), pair.getValue());
54     }
55
56     /**
57      * Constructs a new entry from the specified MapEntry.
58      *
59      * @param entry the entry to copy, must not be null
60      * @throws NullPointerException if the entry is null
61      */

62     public DefaultMapEntry(final Map.Entry JavaDoc entry) {
63         super(entry.getKey(), entry.getValue());
64     }
65
66 }
67
Popular Tags