java.util.AbstractSet翻译

来源:互联网 发布:淘宝店铺号可以买吗 编辑:程序博客网 时间:2024/05/21 01:55
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

  java/util/abstractset.html#skip-navbar_top" />overviewjava/util/package-summary.html" />packageclassjava/util/class-use/abstractset.html" />usejava/util/package-tree.html" />treedeprecatedindexhelpjavaTM2PlatformStd.Ed. v1.4.2 java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/abstractsequentiallist.html" />PREV CLASS java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/arraylist.html" />NEXT CLASSFRAMES java/util/abstractset.html" target="_top" />NO FRAMES

 

  All Classes SUMMARY:NESTED|FIELD|java/util/abstractset.html#constructor_summary" />CONSTR|java/util/abstractset.html#method_summary" />METHODDETAIL:FIELD|java/util/abstractset.html#constructor_detail" />CONSTR|java/util/abstractset.html#method_detail" />METHODjava.util Class AbstractSetjava.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/object.html" />java.lang.Object

  java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/abstractcollection.html" />java.util.AbstractCollection

  java.util.AbstractSet

  All Implemented Interfaces: java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/collection.html" />Collection, java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/set.html" />Set Direct Known Subclasses: java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/hashset.html" />HashSet, java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/treeset.html" />TreeSet public abstract class AbstractSet extends java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/abstractcollection.html" />AbstractCollection implements java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/set.html" />SetThis class provides a skeletal implementation of the Set interface to minimize the effort required to implement this interface. 该类提供了接口Set的框架实现,用来降低实现该接口的复杂程度。 The process of implementing a set by extending this class is identical to that of implementing a Collection by extending AbstractCollection, except that all of the methods and constructors in subclasses of this class must obey the additional constraints imposed by the Set interface (for instance, the add method must not permit addition of multiple intances of an object to a set). 通过继承该类以实现set的过程和通过继承AbstractCollection实现Collection一样, 除了该类子类的所有方法和构造函数必须遵守Set接口的一些额外约定(例如,add方法不允许向set中加入重复对象)。 Note that this class does not override any of the implementations from the AbstractCollection class. It merely adds implementations for equals and hashCode. 注意该类没有重载AbstractCollection类的任何实现。它只是增加了equals和hashCode的实现。 This class is a member of the java Collections Framework. 该类是java集合框架成员之一。 Since: 1.2 See Also: java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/collection.html" />Collection, java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/abstractcollection.html" />AbstractCollection, java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/set.html" />Setconstructor summaryprotected java/util/abstractset.html#abstractset()" />abstractset() sole constructor. 唯一的构造函数。 method summarybooleanjava/util/abstractset.html#equals(java.lang.object)" />equals(java.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/object.html" />objecto) compares the specified object with this set for equality. 将指定对象和当前set就相等性进行比较。intjava/util/abstractset.html#hashcode()" />hashcode() returns the hash code value for this set. 返回set的哈希码值。booleanjava/util/abstractset.html#removeall(java.util.collection)" />removeall(java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/collection.html" />collectionc) removes from this set all of its elements that are contained in the specified collection (optional operation). 从set中删除指定集合所包含的所有元素(可选操作)。java.util.abstractcollection" /> methods inherited from class java.util.java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/abstractcollection.html" />abstractcollectionadd, java/util/abstractcollection.html#addall(java.util.collection)" />addall, java/util/abstractcollection.html#clear()" />clear, java/util/abstractcollection.html#contains(java.lang.object)" />contains, java/util/abstractcollection.html#containsall(java.util.collection)" />containsall, java/util/abstractcollection.html#isempty()" />isempty, java/util/abstractcollection.html#iterator()" />iterator, java/util/abstractcollection.html#remove(java.lang.object)" />remove, java/util/abstractcollection.html#retainall(java.util.collection)" />retainall, java/util/abstractcollection.html#size()" />size, java/util/abstractcollection.html#toarray()" />toarray, java/util/abstractcollection.html#toarray(java.lang.object[])" />toarray, java/util/abstractcollection.html#tostring()" />tostringjava.lang.object" /> methods inherited from class java.lang.java.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/object.html" />objectclone, java/lang/object.html#finalize()" />finalize, java/lang/object.html#getclass()" />getclass, java/lang/object.html#notify()" />notify, java/lang/object.html#notifyall()" />notifyall, java/lang/object.html#wait()" />wait, java/lang/object.html#wait(long)" />wait, java/lang/object.html#wait(long, int)" />waitjava.util.set" /> methods inherited from interface java.util.java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/set.html" />setadd, java/util/set.html#addall(java.util.collection)" />addall, java/util/set.html#clear()" />clear, java/util/set.html#contains(java.lang.object)" />contains, java/util/set.html#containsall(java.util.collection)" />containsall, java/util/set.html#isempty()" />isempty, java/util/set.html#iterator()" />iterator, java/util/set.html#remove(java.lang.object)" />remove, java/util/set.html#retainall(java.util.collection)" />retainall, java/util/set.html#size()" />size, java/util/set.html#toarray()" />toarray, java/util/set.html#toarray(java.lang.object[])" />toarray constructor detailAbstractSetprotected AbstractSet()Sole constructor. (For invocation by subclass constructors, typically implicit.) 唯一的构造函数。(通常由子类隐式调用) method detailjava.lang.object)" />equalspublic boolean equals(java.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/object.html" />Objecto)Compares the specified object with this set for equality. Returns true if the given object is also a set, the two sets have the same size, and every member of the given set is contained in this set. This ensures that the equals method works properly across different implementations of the Set interface. 将指定对象和当前set就相等性进行比较。如果指定对象也是一个set,两个set有着相同大小,指定set的每一个成员在当前 set中。该定义可以保证对于set接口的不同实现,equals方法都能正常工作。 This implementation first checks if the specified object is this set; if so it returns true. Then, it checks if the specified object is a set whose size is identical to the size of this set; if not, it it returns false. If so, it returns containsAll((Collection) o). 实现首先检查指定对象是否是当前set,如果是返回true。然后,检查指定对象是否是一个set,大小是否和当前set的一样, 如果不是,返回false。如果是,返回containsAll((Collection) o)。 Specified by: java/util/set.html#equals(java.lang.object)" />equals in interface java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/set.html" />Set Overrides: java/lang/object.html#equals(java.lang.object)" />equals in class java.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/object.html" />ObjectParameters: o - Object to be compared for equality with this set. 同当前set比较相等性的Object。 Returns: true if the specified object is equal to this set. 如果指定对象和当前set相等,返回true。 See Also: java/lang/object.html#hashcode()" />Object.hashCode(), java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/hashtable.html" />HashtablehashCodepublic int hashCode()Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object.hashCode. 返回set的哈希码值。set的哈希码被定义为set中元素的哈希码之和, 这里null元素的哈希码被定义为0。 这将保证对于两个set s1和s2, s1.equals(s2)意味着s1.hashCode()==s2.hashCode(),遵循 Object.hashCode方法的一般约定。 This implementation enumerates over the set, calling the hashCode method on each element in the collection, and adding up the results. 实现对set进行枚举,对集合中每一个元素调用hashCode方法,然后将结果相加。 Specified by: java/util/set.html#hashcode()" />hashCode in interface java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/set.html" />Set Overrides: java/lang/object.html#hashcode()" />hashCode in class java.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/object.html" />ObjectReturns: the hash code value for this set. set的哈希码值。 See Also: java/lang/object.html#equals(java.lang.object)" />Object.equals(java.lang.Object), java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/hashtable.html" />Hashtablejava.util.collection)" />removeAllpublic boolean removeAll(java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/collection.html" />Collectionc)Removes from this set all of its elements that are contained in the specified collection (optional operation). 从set中删除指定集合所包含的所有元素(可选操作)。 This implementation determines which is the smaller of this set and the specified collection, by invoking the size method on each. If this set has fewer elements, then the implementation iterates over this set, checking each element returned by the iterator in turn to see if it is contained in the specified collection. If it is so contained, it is removed from this set with the iterator's remove method. If the specified collection has fewer elements, then the implementation iterates over the specified collection, removing from this set each element returned by the iterator, using this set's remove method. 该实现首先通过调用size方法来确定当前set和指定集合哪个更小。如果set的元素更少, 那么实现遍历set,按顺序检查由迭代器返回的每一个元素,查看指定集合中是否包含。 如果包含,使用迭代器的remove方法从set中删除。如果指定集合的元素更少,那么遍历指定集合, 使用set的remove方法来从set中删除由迭代器返回的每一个元素。 Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method. 注意如果由iterator方法返回的迭代器没有实现remove方法,实现将抛出UnsupportedOperationException。 Specified by: java/util/set.html#removeall(java.util.collection)" />removeAll in interface java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/set.html" />Set Overrides: java/util/abstractcollection.html#removeall(java.util.collection)" />removeAll in class java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/abstractcollection.html" />AbstractCollectionParameters: c - elements to be removed from this set. 要从set中删除的元素。 Returns: true if this set changed as a result of the call. 如果调用的结果改变了set,返回true。 Throws: java.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/unsupportedoperationexception.html" />UnsupportedOperationException - removeAll is not supported by this set. set不支持removeAll则抛出。 java.lang" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/lang/nullpointerexception.html" />NullPointerException - if the specified collection is null. 如果指定集合为null时抛出。 See Also: java/util/abstractcollection.html#remove(java.lang.object)" />AbstractCollection.remove(Object), java/util/abstractcollection.html#contains(java.lang.object)" />AbstractCollection.contains(Object)java/util/abstractset.html#skip-navbar_bottom" />overviewjava/util/package-summary.html" />packageclassjava/util/class-use/abstractset.html" />usejava/util/package-tree.html" />treedeprecatedindexhelpjavaTM2PlatformStd.Ed. v1.4.2 java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/abstractsequentiallist.html" />PREV CLASS java.util" href="file:///f:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/java/util/arraylist.html" />NEXT CLASSFRAMES java/util/abstractset.html" target="_top" />NO FRAMES

 

  All Classes SUMMARY:NESTED|FIELD|java/util/abstractset.html#constructor_summary" />CONSTR|java/util/abstractset.html#method_summary" />METHODDETAIL:FIELD|java/util/abstractset.html#constructor_detail" />CONSTR|java/util/abstractset.html#method_detail" />METHODjava.sun.com/cgi-bin/bugreport.cgi" />Submit a bug or featureFor 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 java.sun.com/docs/redist.html" />documentation redistribution policy.

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>