分享
 
 
 

java.util.Dictionary翻译

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

[/url] [url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview

Package

Class

Use

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Std. Ed. v1.4.2

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

java.util

Class Dictionaryjava.lang.Object

java.util.Dictionary

Direct Known Subclasses: Hashtable public abstract class Dictionary extends ObjectThe Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to values. Every key and every value is an object. In any one Dictionary object, every key is associated with at most one value. Given a Dictionary and a key, the associated element can be looked up. Any non-null object can be used as a key and as a value. Dictionary是一个抽象类,可以作为某些映射key与值的类的父类,比如Hashtable。 每个key和每个值都是一个对象。在任意一个Dictionary对象中,每一个key至多只能与一个 值关联。给定Dictionary和key,可以查找相关联的元素。任何非null对象都可以作为key或值。

As a rule, the equals method should be used by implementations of this class to decide if two keys are the same. 原则上equals方法应当在该类的实现中使用,来确定两个key是否相同。

NOTE: This class is obsolete. New implementations should implement the Map interface, rather than extending this class. 注意:该类已过时。新的实现应该实现Map接口,而不是继承该类。

Since: JDK1.0 See Also: Map, Object.equals(java.lang.Object), Object.hashCode(), HashtableConstructor Summary

Dictionary()

Sole constructor. 唯一的构造函数。

Method Summary

abstract Enumeration

elements()

Returns an enumeration of the values in this dictionary. 返回dictionary中值的枚举。

abstract Object

get(Object key)

Returns the value to which the key is mapped in this dictionary. 返回dictionary中key的映射值。

abstract boolean

isEmpty()

Tests if this dictionary maps no keys to value. 测试该dictionary是否有键值的映射。

abstract Enumeration

keys()

Returns an enumeration of the keys in this dictionary. 返回dictionary中key的枚举。

abstract Object

put(Object key, Object value)

Maps the specified key to the specified value in this dictionary. 在dictionary中为指定的key和指定的value建立映射。

abstract Object

remove(Object key)

Removes the key (and its corresponding value) from this dictionary. 从dictionary中删除key(和它的相应值)。

abstract int

size()

Returns the number of entries (dinstint keys) in this dictionary. 返回dictionary中项的数目(不同的key)。

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Dictionarypublic Dictionary()

Sole constructor. (For invocation by subclass constructors, typically implicit.) 唯一的构造函数。(通常被子类构造函数隐式调用)

Method Detail

sizepublic abstract int size()

Returns the number of entries (dinstint keys) in this dictionary. 返回dictionary中项的数目(不同的key)。

Returns: the number of keys in this dictionary. dictionary中key的数目。isEmptypublic abstract boolean isEmpty()

Tests if this dictionary maps no keys to value. The general contract for the isEmpty method is that the result is true if and only if this dictionary contains no entries. 测试该dictionary是否有键值的映射。isEmpty方法通常约定为:只有当dictionary中不含项时结果才为true。

Returns: true if this dictionary maps no keys to values; false otherwise. 如果dictionary不含键值的映射,返回true,否则为false。keyspublic abstract Enumeration keys()

Returns an enumeration of the keys in this dictionary. The general contract for the keys method is that an Enumeration object is returned that will generate all the keys for which this dictionary contains entries. 返回dictionary中key的枚举。keys方法通常约定为:返回Enumeration对象,包含dictionary所含项的所有key。

Returns: an enumeration of the keys in this dictionary. dictionary中key的枚举。 See Also: elements(), Enumerationelementspublic abstract Enumeration elements()

Returns an enumeration of the values in this dictionary. The general contract for the elements method is that an Enumeration is returned that will generate all the elements contained in entries in this dictionary. 返回dictionary中值的枚举。elements方法通常约定为:返回Enumeration对象,元素等于dictionary的所含项。

Returns: an enumeration of the values in this dictionary. dictionary中值的枚举。 See Also: keys(), Enumerationgetpublic abstract Object get(Object key)

Returns the value to which the key is mapped in this dictionary. The general contract for the isEmpty method is that if this dictionary contains an entry for the specified key, the associated value is returned; otherwise, null is returned. 返回dictionary中key的映射值。get方法通常约定为:如果该dictionary包含指定key的项,返回关联值,否则返回null。

Parameters: key - a key in this dictionary. dictionary中的key。 null if the key is not mapped to any value in this dictionary. 如果dictionary中该key没有映射任何值。 Returns: the value to which the key is mapped in this dictionary; dictionary中key的映射值。 Throws: NullPointerException - if the key is null 如果key为null时抛出。. See Also: put(java.lang.Object, java.lang.Object)putpublic abstract Object put(Object key,

Object value)

Maps the specified key to the specified value in this dictionary. Neither the key nor the value can be null. 在dictionary中为指定的key和指定的value建立映射。key和value都不能为null。 If this dictionary already contains an entry for the specified key, the value already in this dictionary for that key is returned, after modifying the entry to contain the new element.

If this dictionary does not already have an entry for the specified key, an entry is created for the specified key and value, and null is returned. 如果dictionary已经包含了一个指定key的项,在修改项使包含新的元素后,返回该key在dictionary中的原值。 如果dictionary不含一个指定key的项,则创建一个指定key和value的项,返回null。

The value can be retrieved by calling the get method with a key that is equal to the original key. 返回的值可以通过调用get方法获取(key为原key)。

Parameters: key - the hashtable key. hash表中的key。 value - the value. 值。 Returns: the previous value to which the key was mapped in this dictionary, or null if the key did not have a previous mapping. dictionary中key映射的原值,如果该key原本没有映射,返回null。 Throws: NullPointerException - if the key or value is null key或value为null时抛出。. See Also: Object.equals(java.lang.Object), get(java.lang.Object)removepublic abstract Object remove(Object key)

Removes the key (and its corresponding value) from this dictionary. This method does nothing if the key is not in this dictionary. 从dictionary中删除key(和它的相应值)。如果dictionary中没有该key,方法什么也不做。

Parameters: key - the key that needs to be removed. 要被删除的key。 Returns: the value to which the key had been mapped in this dictionary, or null if the key did not have a mapping. key在dictionary中映射的值,如果该key没有映射,返回null。 Throws: NullPointerException - if key is null. 如果key为null时抛出。[/url][url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview

Package

Class

Use

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Std. Ed. v1.4.2

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature

For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有