网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > Java
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.实现RSS.
.Spring与WebLogic Server的.
.关于继承和接口的一个非常有趣的.
.数据库驱动程序测试的建议.
.java自动在中关村二手市场发布信.
.浅谈Java中利用JCOM实现仿Excel编.
.Java入门——Java修饰词总结.
.java高级多线程编程(一)--关于线.
.共享内存在Java中的实现和应用.
.abs 方法.
.Apache FOP 0.91 .
.Java核心代码例程之:RMIExample.
.Java Applet实现声音和图像的协调.
.感受JDO 2.0查询语言的特点.
.WriteBlankLines 方法.
.Weblogic Server实现EOS负载.
.Struts源码研究-Bean-Message标签.
.采用POI和ANTLR提取WORD文档数据.
.JAVA入门教程:第二章.
.Java初学问题实录(四).

java.util.Map翻译

发表日期:2008-1-5


 Overview Package  Class Use Tree Deprecated Index Help JavaTM 2 Platform
Std. Ed. v1.4.2
 PREV CLASS   NEXT CLASSFRAMES    NO FRAMES     All Classes SUMMARY: NESTED  FIELD  CONSTR  METHODDETAIL: FIELD  CONSTR  METHOD


java.util
Interface Map

All Known Subinterfaces:
SortedMap
All Known Implementing Classes:
AbstractMap, Attributes, HashMap, Hashtable, IdentityHashMap, RenderingHints, TreeMap, WeakHashMap

public interface Map

An object that maps keys to values. A map cannot contain duplicate keys; each key can map to at most one value. 一个由要害字映射到值的对象。一个map不能包含相同的要害字,每一个要害字至多映射到一个值。

This interface takes the place of the Dictionary class, which was a totally abstract class rather than an interface. 这个接口替换了Dictionary类——它是个完全的抽象类,而非接口。

The Map interface provides three collection views, which allow a map's contents to be viewed as a set of keys, collection of values, or set of key-value mappings. The order of a map is defined as the order in which the iterators on the map's collection views return their elements. Some map implementations, like the TreeMap class, make specific guarantees as to their order; others, like the HashMap class, do not. Map接口提供了三种collection视图访问map的内容,包括key的set,值的collection,要害字—值映射对的set。 map的顺序定义为map集合视图迭代返回元素的顺序。一些map的实现,如TreeMap类,提供指定顺序 的保证,而其他的如HashMap则没有。

Note: great care must be exercised if mutable objects are used as map keys. The behavior of a map is not specified if the value of an object is changed in a manner that affects equals comparisons while the object is a key in the map. A special case of this prohibition is that it is not permissible for a map to contain itself as a key. While it is permissible for a map to contain itself as a value, extreme caution is advised: the equals and hashCode methods are no longer well defined on a sUCh a map. 注重:假如使用可变对象作为map的key时,应相当小心。当某对象是map中的key时,以某种方式改变了对象值而影响相等性比较,那么map的行为不能确定。假如map以自身作为key,这样的非凡情况是禁止的。然而map以自身作为值是答应的,不过需要严重警告的是:这样一个map,所定义的equals和hashCode方法将不再有效。

All general-purpose map implementation classes should provide two "standard" constructors: a void (no arguments) constructor which creates an empty map, and a constructor with a single argument of type Map, which creates a new map with the same key-value mappings as its argument. In effect, the latter constructor allows the user to copy any map, producing an equivalent map of the desired class. There is no way to enforce this recommendation (as interfaces cannot contain constructors) but all of the general-purpose map implementations in the SDK comply. 所有通用map的实现类都必须提供两个标准构造函数:一个不含参数的空构造函数,创建一个空map,一个单Map类型参数的构造函数,使用和参数相同的映射关系创建一个新map。实际上,后者答应用户拷贝任何map来生成一个相等的map。虽然没有办法来强制执行(因为接口不含构造函数)但是SDK中的所有通用map实现均是如此。


上一篇:osworkflow descriptor 解析 重要概念 人气:601
下一篇:osworkflow descriptor 解析片断 人气:683
浏览全部Java的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐