java.util
Class HashMap.Values

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

private class HashMap.Values
extends AbstractCollection


Constructor Summary
private HashMap.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.
 int size()
          Returns the number of elements in this collection.
 
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, remove, 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

HashMap.Values

private HashMap.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.

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