java.util
Class IdentityHashMap.Values

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.IdentityHashMap.Values
All Implemented Interfaces:
Collection
Enclosing class:
IdentityHashMap

private class IdentityHashMap.Values
extends AbstractCollection


Constructor Summary
private IdentityHashMap.Values()
           
 
Method Summary
 void clear()
          Removes all of the elements from this collection (optional operation).
 boolean contains(Object o)
          Returns true if this collection contains the specified element.
 Iterator iterator()
          Returns an iterator over the elements contained in this collection.
 boolean remove(Object o)
          Removes a single instance of the specified element from this collection, if it is present (optional operation).
 int size()
          Returns the number of elements in this collection.
 
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

IdentityHashMap.Values

private IdentityHashMap.Values()
Method Detail

iterator

public Iterator iterator()
Description copied from class: AbstractCollection
Returns an iterator over the elements contained in this collection.

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

size

public int size()
Description copied from class: AbstractCollection
Returns the number of elements in this collection. If the collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

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

contains

public boolean contains(Object o)
Description copied from class: AbstractCollection
Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)).

This implementation iterates over the elements in the collection, checking each element in turn for equality with the specified element.

Specified by:
contains in interface Collection
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 class: AbstractCollection
Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if the collection contains one or more such elements. Returns true if the collection contained the specified element (or equivalently, if the collection changed as a result of the call).

This implementation iterates over the collection looking for the specified element. If it finds the element, it removes the element from the collection using the iterator's remove method.

Note that this implementation throws an UnsupportedOperationException if the iterator returned by this collection's iterator method does not implement the remove method and this collection contains the specified object.

Specified by:
remove in interface Collection
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.

clear

public void clear()
Description copied from class: AbstractCollection
Removes all of the elements from this collection (optional operation). The collection will be empty after this call returns (unless it throws an exception).

This implementation iterates over this collection, removing each element using the Iterator.remove operation. Most implementations will probably choose to override this method for efficiency.

Note that this implementation will throw an UnsupportedOperationException if the iterator returned by this collection's iterator method does not implement the remove method and this collection is non-empty.

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