Source Code Cross Referenced for Dictionary.java in  » 6.0-JDK-Core » Collections-Jar-Zip-Logging-regex » java » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Collections Jar Zip Logging regex » java.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1995-2004 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.util;
027
028        /**
029         * The <code>Dictionary</code> class is the abstract parent of any 
030         * class, such as <code>Hashtable</code>, which maps keys to values. 
031         * Every key and every value is an object. In any one <tt>Dictionary</tt> 
032         * object, every key is associated with at most one value. Given a 
033         * <tt>Dictionary</tt> and a key, the associated element can be looked up. 
034         * Any non-<code>null</code> object can be used as a key and as a value.
035         * <p>
036         * As a rule, the <code>equals</code> method should be used by 
037         * implementations of this class to decide if two keys are the same. 
038         * <p>
039         * <strong>NOTE: This class is obsolete.  New implementations should
040         * implement the Map interface, rather than extending this class.</strong>
041         *
042         * @author  unascribed
043         * @version 1.30, 05/05/07
044         * @see	    java.util.Map
045         * @see     java.lang.Object#equals(java.lang.Object)
046         * @see     java.lang.Object#hashCode()
047         * @see     java.util.Hashtable
048         * @since   JDK1.0
049         */
050        public abstract class Dictionary<K, V> {
051            /**
052             * Sole constructor.  (For invocation by subclass constructors, typically
053             * implicit.)
054             */
055            public Dictionary() {
056            }
057
058            /**
059             * Returns the number of entries (distinct keys) in this dictionary.
060             *
061             * @return  the number of keys in this dictionary.
062             */
063            abstract public int size();
064
065            /**
066             * Tests if this dictionary maps no keys to value. The general contract 
067             * for the <tt>isEmpty</tt> method is that the result is true if and only 
068             * if this dictionary contains no entries. 
069             *
070             * @return  <code>true</code> if this dictionary maps no keys to values;
071             *          <code>false</code> otherwise.
072             */
073            abstract public boolean isEmpty();
074
075            /**
076             * Returns an enumeration of the keys in this dictionary. The general 
077             * contract for the keys method is that an <tt>Enumeration</tt> object 
078             * is returned that will generate all the keys for which this dictionary 
079             * contains entries. 
080             *
081             * @return  an enumeration of the keys in this dictionary.
082             * @see     java.util.Dictionary#elements()
083             * @see     java.util.Enumeration
084             */
085            abstract public Enumeration<K> keys();
086
087            /**
088             * Returns an enumeration of the values in this dictionary. The general 
089             * contract for the <tt>elements</tt> method is that an 
090             * <tt>Enumeration</tt> is returned that will generate all the elements 
091             * contained in entries in this dictionary.
092             *
093             * @return  an enumeration of the values in this dictionary.
094             * @see     java.util.Dictionary#keys()
095             * @see     java.util.Enumeration
096             */
097            abstract public Enumeration<V> elements();
098
099            /**
100             * Returns the value to which the key is mapped in this dictionary. 
101             * The general contract for the <tt>isEmpty</tt> method is that if this 
102             * dictionary contains an entry for the specified key, the associated 
103             * value is returned; otherwise, <tt>null</tt> is returned. 
104             *
105             * @return  the value to which the key is mapped in this dictionary;
106             * @param   key   a key in this dictionary.
107             *          <code>null</code> if the key is not mapped to any value in
108             *          this dictionary.
109             * @exception NullPointerException if the <tt>key</tt> is <tt>null</tt>.
110             * @see     java.util.Dictionary#put(java.lang.Object, java.lang.Object)
111             */
112            abstract public V get(Object key);
113
114            /**
115             * Maps the specified <code>key</code> to the specified 
116             * <code>value</code> in this dictionary. Neither the key nor the 
117             * value can be <code>null</code>.
118             * <p>
119             * If this dictionary already contains an entry for the specified 
120             * <tt>key</tt>, the value already in this dictionary for that 
121             * <tt>key</tt> is returned, after modifying the entry to contain the
122             *  new element. <p>If this dictionary does not already have an entry 
123             *  for the specified <tt>key</tt>, an entry is created for the 
124             *  specified <tt>key</tt> and <tt>value</tt>, and <tt>null</tt> is 
125             *  returned.
126             * <p>
127             * The <code>value</code> can be retrieved by calling the 
128             * <code>get</code> method with a <code>key</code> that is equal to 
129             * the original <code>key</code>. 
130             *
131             * @param      key     the hashtable key.
132             * @param      value   the value.
133             * @return     the previous value to which the <code>key</code> was mapped
134             *             in this dictionary, or <code>null</code> if the key did not
135             *             have a previous mapping.
136             * @exception  NullPointerException  if the <code>key</code> or
137             *               <code>value</code> is <code>null</code>.
138             * @see        java.lang.Object#equals(java.lang.Object)
139             * @see        java.util.Dictionary#get(java.lang.Object)
140             */
141            abstract public V put(K key, V value);
142
143            /**
144             * Removes the <code>key</code> (and its corresponding 
145             * <code>value</code>) from this dictionary. This method does nothing 
146             * if the <code>key</code> is not in this dictionary. 
147             *
148             * @param   key   the key that needs to be removed.
149             * @return  the value to which the <code>key</code> had been mapped in this
150             *          dictionary, or <code>null</code> if the key did not have a
151             *          mapping.
152             * @exception NullPointerException if <tt>key</tt> is <tt>null</tt>.
153             */
154            abstract public V remove(Object key);
155        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.