Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
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

An 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 returns true if they are equal.
int hashCode ()
Returns the hash code for this set.
boolean )">removeAll ( Collection <?> collection)
Removes all occurrences in this collection which are contained 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 ()

Added in API level 1

Constructs a new instance of this AbstractSet.

Public Methods

public boolean equals ( Object object)

Added in API level 1

Compares the specified object to this Set and returns true 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 set.
Returns
  • true if the specified object is equal to this set, false otherwise
See Also

public int hashCode ()

Added in API level 1

Returns the hash code for this set. Two set which are equal must return the same value. This implementation calculates the hash code by adding each element's hash code.

Returns
  • the hash code of this set.
)">

public boolean removeAll ( Collection <?> collection)

Added in API level 1

Removes all occurrences in this collection which are contained in the specified collection.

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