加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090218033849/http://developer.android.com:80/reference/java/util/AbstractSet.html
public abstract class

AbstractSet

extends AbstractCollection<E>
implements Set<E>
java.lang.Object
   ↳ java.util.AbstractCollection<E>
     ↳ java.util.AbstractSet<E>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

AbstractSet is an abstract implementation of the Set interface. This Implementation does not support adding. A subclass must implement the abstract methods iterator() and size().

Summary

Protected Constructors
AbstractSet()
Constructs a new instance of this AbstractSet.
Public Methods
boolean equals(Object object)
Compares the specified object to this Set and answer if they are equal.
int hashCode()
Returns an integer hash code for the receiver.
boolean removeAll(Collection<?> collection)
Removes all occurrences in this Collection of each object in the specified Collection.
[Expand]
Inherited Methods
From class java.util.AbstractCollection
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.Set

Protected Constructors

protected AbstractSet ()

Constructs a new instance of this AbstractSet.

Public Methods

public boolean equals (Object object)

Compares the specified object to this Set and answer if they are equal. The object must be an instance of Set and contain the same objects.

Parameters
object the object to compare with this object
Returns
  • true if the specified object is equal to this Set, false otherwise
See Also

public int hashCode ()

Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Returns
  • the receiver's hash
See Also

public boolean removeAll (Collection<?> collection)

Removes all occurrences in this Collection of each object in the specified Collection.

Parameters
collection the Collection of objects to remove
Returns
  • true if this Collection is modified, false otherwise
Throws
UnsupportedOperationException when removing from this Collection is not supported