java.util
Class IdentityHashMap.EntrySet

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractSet
          extended byjava.util.IdentityHashMap.EntrySet
All Implemented Interfaces:
Collection, Set
Enclosing class:
IdentityHashMap

private class IdentityHashMap.EntrySet
extends AbstractSet


Constructor Summary
private IdentityHashMap.EntrySet()
           
 
Method Summary
 void clear()
          Removes all of the elements from this set (optional operation).
 boolean contains(Object o)
          Returns true if this set contains the specified element.
 Iterator iterator()
          Returns an iterator over the elements in this set.
 boolean remove(Object o)
          Removes the specified element from this set if it is present (optional operation).
 boolean removeAll(Collection c)
          Removes from this set all of its elements that are contained in the specified collection (optional operation).
 int size()
          Returns the number of elements in this set (its cardinality).
 Object[] toArray()
          Returns an array containing all of the elements in this set.
 Object[] toArray(Object[] a)
          Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, containsAll, isEmpty, retainAll
 

Constructor Detail

IdentityHashMap.EntrySet

private IdentityHashMap.EntrySet()
Method Detail

iterator

public Iterator iterator()
Description copied from interface: Set
Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Specified by:
iterator in interface Set
Specified by:
iterator in class AbstractCollection
Returns:
an iterator over the elements contained in this collection.

contains

public boolean contains(Object o)
Description copied from interface: Set
Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that (o==null ? e==null : o.equals(e)).

Specified by:
contains in interface Set
Overrides:
contains in class AbstractCollection
Parameters:
o - object to be checked for containment in this collection.
Returns:
true if this collection contains the specified element.

remove

public boolean remove(Object o)
Description copied from interface: Set
Removes the specified element from this set if it is present (optional operation). More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if the set contains such an element. Returns true if the set contained the specified element (or equivalently, if the set changed as a result of the call). (The set will not contain the specified element once the call returns.)

Specified by:
remove in interface Set
Overrides:
remove in class AbstractCollection
Parameters:
o - element to be removed from this collection, if present.
Returns:
true if the collection contained the specified element.

size

public int size()
Description copied from interface: Set
Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Specified by:
size in interface Set
Specified by:
size in class AbstractCollection
Returns:
the number of elements in this collection.

clear

public void clear()
Description copied from interface: Set
Removes all of the elements from this set (optional operation). This set will be empty after this call returns (unless it throws an exception).

Specified by:
clear in interface Set
Overrides:
clear in class AbstractCollection

removeAll

public boolean removeAll(Collection c)
Description copied from class: AbstractSet
Removes from this set all of its elements that are contained in the specified collection (optional operation).

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.

Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method.

Specified by:
removeAll in interface Set
Overrides:
removeAll in class AbstractSet
Parameters:
c - elements to be removed from this set.
Returns:
true if this set changed as a result of the call.
See Also:
AbstractCollection.remove(Object), AbstractCollection.contains(Object)

toArray

public Object[] toArray()
Description copied from interface: Set
Returns an array containing all of the elements in this set. Obeys the general contract of the Collection.toArray method.

Specified by:
toArray in interface Set
Overrides:
toArray in class AbstractCollection
Returns:
an array containing all of the elements in this collection.

toArray

public Object[] toArray(Object[] a)
Description copied from interface: Set
Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array. Obeys the general contract of the Collection.toArray(Object[]) method.

Specified by:
toArray in interface Set
Overrides:
toArray in class AbstractCollection
Parameters:
a - the array into which the elements of the collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
an array containing the elements of the collection.