为了正常的体验网站,请在浏览器设置里面开启Javascript功能!
首页 > 关于JDK API外文翻译

关于JDK API外文翻译

2018-05-29 12页 doc 38KB 42阅读

用户头像

is_014457

暂无简介

举报
关于JDK API外文翻译关于JDK API外文翻译 英文原文 ABOUT JDK API Abstract Java Platform, Standard Edition 6 API Specification ,This document is the API specification for version 6 of the Java Platform, Standard Edition. The Overview page is the front page of this API document and provides a li...
关于JDK API外文翻译
关于JDK API外文翻译 英文原文 ABOUT JDK API Abstract Java Platform, Standard Edition 6 API Specification ,This document is the API specification for version 6 of the Java Platform, Standard Edition. The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages. There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object. Introduction Class/InterfaceEach class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions: Class inheritance diagram,Direct Subclasses,All Known Subinterfaces,All Known Implementing Classes,Class/interface declaration,Class/interface description ,Nested Class Summary,Field Summary,Constructor Summary,Method Summary ,Field Detail,Constructor Detail,Method Detail.Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed .descriptions are in the order they appear in the source code. This preserves .the logical groupings established by the programmer. 1 Class AbstractAction This class provides default implementations for the JFC Action interface. Standard behaviors like the get and set methods for Action object properties (icon, 1 text, and enabled) are defined here. The developer need only subclass this abstract class and define the actionPerformed method. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. 2 Class AbstractButton Defines common behaviors for buttons and menu items.Buttons can be configured, and to some degree controlled, by Actions. Using an Action with a button has many benefits beyond directly configuring a button. Refer to Swing Components Supporting Action for more details, and you can find more information in How to Use Actions, a section in The Java Tutorial. For further information see How to Use Buttons, Check Boxes, and Radio Buttons, a section in The Java Tutorial. Warning: Serialized objects of this class will not be compatible with futureSwing releases. The current serialization support is appropriate for shortterm storage or RMI between applications running the same version of Swing. 3 Class AbstractDocument An implementation of the document interface to serve as a basis for implementing various kinds of documents. At this level there is very little policy, so there is a corresponding increase in difficulty of use. This class implements a locking mechanism for the document. It allows multiple readers or one writer, and writers must wait until all observers of the document have been notified of a previous change before beginning another mutation to the document. The read lock is acquired and released using the render method. A write lock is aquired by the methods that mutate the document, and are held for the duration of the method call. Notification is done on the thread that produced the mutation, and the thread has full read access to the document for the duration of the notification, but other readers are kept out until the notification has finished. The notification is a beans event notification which does not allow any further mutations until all listeners have been notified. Any models 2 subclassed from this class and used in conjunction with a text component that has a look and feel implementation that is derived from BasicTextUI may be safely updated asynchronously, because all access to the View hierarchy is serialized by BasicTextUI if the document is of type AbstractDocument. The locking assumes that an independent thread will access the View hierarchy only from the DocumentListener methods, and that there will be only one event thread active at a time. If concurrency support is desired, there are the following additional implications. The code path for any DocumentListener implementation and any UndoListener implementation must be threadsafe, and not access the component lock if trying to be safe from deadlocks. The repaint and revalidate methods on JComponent are safe. AbstractDocument models an implied break at the end of the document. Among other things this allows you to position the caret after the last character. As a result of this, getLength returns one less than the length of the Content. If you create your own Content, be sure and initialize it to have an additional character. Refer to StringContent and GapContent for examples of this. Another implication of this is that Elements that model the implied end character will have an endOffset == (getLength() + 1). For example, in DefaultStyledDocument getParagraphElement(getLength()).getEndOffset() == getLength() + 1 . Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. 4 Class AbstractList This class provides a skeletal implementation of the List interface to minimize the effort required to implement this interface backed by a "random access" data store (such as an array). For sequential access data (such as a linked list), AbstractSequentialList should be used in preference to this class. To implement an unmodifiable list, the programmer needs only to extend this class and provide implementations for the get(int) and size() methods. To implement a modifiable list, 3 the programmer must additionally override the set(int, E) method (which otherwise throws an UnsupportedOperationException). If the list is variable-size the programmer must additionally override the add(int, E) and remove(int) methods. The programmer should generally provide a void (no argument) and collection constructor, as per the recommendation in the Collection interface specification. Unlike the other abstract collection implementations, the programmer does not have to provide an iterator implementation; the iterator and list iterator are implemented by this class, on top of the "random access" methods: get(int), set(int, E), add(int, E) and remove(int). The documentation for each non-abstract method in this class describes its implementation in detail. Each of these methods may be overridden if the collection being implemented admits a more efficient implementation. 5 Class BasicAttribute This class provides a basic implementation of the Attribute interface. This implementation does not support the schema methods getAttributeDefinition() and getAttributeSyntaxDefinition(). They simply throw OperationNotSupportedException. Subclasses of BasicAttribute should override these methods if they support them. The BasicAttribute class by default uses Object.equals() to determine equality of attribute values when testing for equality or when searching for values, except when the value is an array. For an array, each element of the array is checked using Object.equals(). Subclasses of BasicAttribute can make use of schema information when doing similar equality checks by overriding methods in which such use of schema is meaningful. Similarly, the BasicAttribute class by default returns the values passed to its constructor and/or manipulated using the add/remove methods. Subclasses of BasicAttribute can override get() and getAll() to get the values dynamically from the directory (or implement the Attribute interface directly instead of subclassing BasicAttribute). Note that updates to BasicAttribute (such as adding or removing a value) does not affect the corresponding representation of the attribute in the directory. Updates to the directory can only be effected using operations in the DirContext interface. A BasicAttribute instance is not synchronized against concurrent 4 multithreaded access. Multiple threads trying to access and modify a BasicAttribute should lock the object. 6 Class ButtonGroup This class is used to create a multiple-exclusion scope for a set of buttons. Creating a set of buttons with the same ButtonGroup object means that turning "on" one of those buttons turns off all other buttons in the group. A ButtonGroup can be used with any set of objects that inherit from AbstractButton. Typically a button group contains instances of JRadioButton, JRadioButtonMenuItem, or JToggleButton. It wouldn't make sense to put an instance of JButton or JMenuItem in a button group because JButton and JMenuItem don't implement the selected state. Initially, all buttons in the group are unselected. For examples and further information on using button groups see How to Use Radio Buttons, a section in The Java Tutorial. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. 5 英文翻译 关于JDK API 摘要 Java Platform Standard Edition 6 API 本文档是 JavaTM Platform Standard Edition 6 的 API 规范。概述 页面是此 API 文档的首页,提供了所有软件包的列表及其摘要。此页面也可能包含这些软件包的总体描述。对于所有软件包,有一个 类分层结构 页面,以及每个软件包的分层结构。每个分层结构页面都包含类的列表和接口的列表。从 java.lang.Object 开始,按继承结构对类进行排列。接口不从 java.lang.Object 继承。 引言 每个类、接口、嵌套类和嵌套接口都有各自的页面。其中每个页面都由三部分(类/接口描述、摘要表,以及详细的成员描述)组成:类继承图,直接子类,所有已知子接口,所有已知实现类,类/接口声明,类/接口描述 ,嵌套类摘要,字段摘要,构造方法摘要,方法摘要 ,字段详细信息,构造方法详细信息,方法详细信息,每个摘要条目都包含该项目的详细描述的第一句。摘要条目按字母顺序排列,而详细描述则按其在源代码中出现的顺序排列。这样保持了程序员所建立的逻辑分组。 1 类 AbstractAction 此类提供 JFC Action 接口的默认实现。它定义了一些标准行为,比如 Action 对象属性(icon、text 和 enabled)的 get 和 set 方法。开发人员只需为此抽象类创建子类并定义 actionPerformed 方法即可。 警告:此类的已序列化 6 对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。 2 类 AbstractButton 定义按钮和菜单项的一般行为按钮可以进行配置,以及通过 Action 进行某种程度的控制。使用带有按钮的 Action具有除直接配置按钮之外的许多优点。有关更多信息,请参阅支持 Action 的 Swing组件,在 The Java Tutorial 中的 How to Use Actions 一节中可以找到更多信息。有关更多信息,请参阅 The Java Tutorial 中的 How to Use Buttons, Check Boxes, and Radio Buttons 一节。警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。 3 类 AbstractDocument 文档接口的实现,可作为实现各种文档的基础。在此级别上几乎没有策略,所以相应地增加了使用难度。 此类实现了文档的锁定机制。它允许多个 reader 或一个 writer,并且在 writer 开始对文档的另一次改变前,必须等到将以前的更改已通知该文档的所有观察者。使用 render 方法获取和释放读取锁定。通过改变文档的那些方法来获取写入锁定,并且在该方法调用期间保持锁定。在生成改变的线程上完成通知,并且在通知期间该线程对文件具有完全的读取访问权限,不过在通知结束前其他 reader 无法读取。该通知是一个 bean 事件通知,只有通知所有侦听器之后才允许进一步的改变。 所有根据此类创建子类且与文本组件(该组件具有派生自 BasicTextUI 的外观实现)一起使用的模型都可安全地进行异步更新,因为如果该文档的类型是 AbstractDocument,则对 View 层次结构的所有访问都是由 BasicTextUI 序列化的。锁定机制假定独立的线程仅从 DocumentListener 方法访问 View 层次结构,并且同一时间只有一个事件线 7 程处于活动状态。如果需要并发支持,则有下列额外的含义。所有 DocumentListener 实现和所有 UndoListener 实现的代码路径必须是线程安全的,并且如果要避免死锁,则不能访问组件锁定。在 JComponent 上执行 repaint 和 revalidate 方法是安全的。 AbstractDocument 在文档的结尾模拟了一个隐含的分隔。除了其他作用,这一功能允许您在最后一个字符的后面定位插入符。因此,getLength 返回一个比 Content 的长度小的值。如果创建自己的 Content,一定要有一个额外的字符并且初始化它。有关此内容的示例,请参见 StringContent 和 GapContent。另一个含义是模拟该隐含结束字符的 Element 具有 endOffset == (getLength() + 1)。例如,在 DefaultStyledDocument 中,getParagraphElement(getLength()).getEndOffset() == getLength() + 1。 警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前的序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。 4 类 AbstractList 此类提供 List 接口的骨干实现,以最大限度地减少实现“随机访问”数据存储(如数组)支持的该接口所需的工作。对于连续的访问数据(如链表),应优先使用 AbstractSequentialList,而不是此类。 要实现不可修改的列表,编程人员只需扩展此类,并提供 get(int) 和 size() 方法的实现。 要实现可修改的列表,编程人员必须另外重写 set(int, E) 方法(否则将抛出 UnsupportedOperationException)。如果列表为可变大小,则编程人员必须另外重写 add(int, E) 和 remove(int) 方法。按照 Collection 接口规范中的建议,编程人员通常应该提供一个 void(无参数)和 collection 构造方法。与其他抽象 collection 实现不同,编程人员不必 提供迭代器实现;迭代器和列表迭代器由此类在以下“随机访问”方法上实现:get(int)、set(int, E)、add(int, E) 和 remove(int)。 此类中每个非抽象方法的文档详细描述了其实现。如果要实现的 collection 允许更有效的实现,则可以重写所有这些方法。 5 类 BasicAttribute 8 此类提供 Attribute 接口的基本实现。此实现不支持模式方法 getAttributeDefinition() 和getAttributeSyntaxDefinition()。它们仅抛出 OperationNotSupportedException。如果 BasicAttribute 的子类支持它们,则其应该重写这些方法。 在测试相等性或搜索值时,BasicAttribute 类默认使用 Object.equals() 确定属性值的相等性,值为数组时除外。对于数组,需要使用 Object.equals() 检查数组的每个元素。在进行类似的相等性检查时,BasicAttribute 的子类可以通过重写那些在其中使用模式具有意义的方法来利用模式信息。类似地,默认情况下 BasicAttribute 类返回传递给其构造方法和/或使用添加/移除方法进行操作的值。BasicAttribute 的子类可以重写 get() 和 getAll(),从目录动态获取值(或者直接实现 Attribute 接口,而不为 BasicAttribute 创建子类)。 注意,更新 BasicAttribute(如添加或移除值)对目录中相应的属性表示形式没有影响。只有使用 DirContext 接口中的操作才能实现对目录的更新。BasicAttribute 实例与并发多线程访问不同步。试图访问并修改 BasicAttribute 的多个线程应该锁定对象。 6 类 ButtonGroup 此类用于为一组按钮创建一个多斥(multiple-exclusion)作用域。使用相同的 ButtonGroup 对象创建一组按钮意味着“开启”其中一个按钮时,将关闭组中的其他所有按钮。可将 ButtonGroup 用于任何从 AbstractButton 继承的对象组。通常,按钮组包含 JRadioButton、JRadioButtonMenuItem 或 JToggleButton 的实例。但将 JButton 或 JMenuItem 的实例放入按钮组中并没有什么意义,因为 JButton 和 JMenuItem 不实现选择状态。 最初,组中的所有按钮都未被选择。 有关使用按钮组的示例和更多信息,请参阅 The Java Tutorial 中的 How to Radio Buttons 一节。警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。 9
/
本文档为【关于JDK API外文翻译】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
热门搜索

历史搜索

    清空历史搜索