1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 | /*
* Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package Torello.Java.ReadOnly;
import java.util.Enumeration;
/**
* Immutable variant of Java Collections Framework abstract class
* <CODE>java.util.Dictionary<K, V></CODE>.
*
* <EMBED CLASS='external-html' DATA-JDK=ReadOnlyDictionary DATA-FILE-ID=ABSTRACT_CLASS>
*
* @param <K> the type of keys
* @param <V> the type of mapped values
*/
@Torello.JavaDoc.JDHeaderBackgroundImg(EmbedTagFileID="JDHBI_INTERFACE")
public interface ReadOnlyDictionary<K, V>
{
/**
* Returns the number of entries (distinct keys) in this dictionary.
* @return the number of keys in this dictionary.
*/
int size();
/**
* Tests if this dictionary maps no keys to value. The general contract for the {@code isEmpty}
* method is that the result is true if and only if this dictionary contains no entries.
*
* @return {@code true} if this dictionary maps no keys to values; {@code false} otherwise.
*/
boolean isEmpty();
/**
* Returns an enumeration of the keys in this dictionary. The general contract for the keys
* method is that an {@code Enumeration} object is returned that will generate all the keys for
* which this dictionary contains entries.
*
* @return an enumeration of the keys in this dictionary.
* @see #elements()
*/
Enumeration<K> keys();
/**
* Returns an enumeration of the values in this dictionary. The general contract for the
* {@code elements} method is that an {@code Enumeration} is returned that will generate all
* the elements contained in entries in this dictionary.
*
* @return an enumeration of the values in this dictionary.
* @see #keys()
*/
Enumeration<V> elements();
/**
* Returns the value to which the key is mapped in this dictionary. The general contract for
* the {@code isEmpty} method is that if this dictionary contains an entry for the specified
* key, the associated value is returned; otherwise, {@code null} is returned.
*
* @return the value to which the key is mapped in this dictionary;
*
* @param key a key in this dictionary. {@code null} if the key is not mapped to any value
* in this dictionary.
*
* @throws NullPointerException if the {@code key} is {@code null}.
*/
V get(Object key);
}
|