com.google.common.collect
Class ForwardingMap.StandardKeySet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<K>
          extended by com.google.common.collect.ForwardingMap.StandardKeySet
All Implemented Interfaces:
Iterable<K>, Collection<K>, Set<K>
Enclosing class:
ForwardingMap<K,V>

@Beta
protected class ForwardingMap.StandardKeySet
extends AbstractSet<K>

A sensible implementation of Map.keySet() in terms of the following methods: ForwardingMap.clear(), ForwardingMap.containsKey(java.lang.Object), ForwardingMap.isEmpty(), ForwardingMap.remove(java.lang.Object), ForwardingMap.size(), and the Set.iterator() method of ForwardingMap.entrySet(). In many cases, you may wish to override ForwardingMap.keySet() to forward to this implementation or a subclass thereof.

Since:
10.0

Constructor Summary
ForwardingMap.StandardKeySet()
           
 
Method Summary
 void clear()
           
 boolean contains(Object o)
           
 boolean isEmpty()
           
 Iterator<K> iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, retainAll, toArray, toArray, 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, retainAll, toArray, toArray
 

Constructor Detail

ForwardingMap.StandardKeySet

public ForwardingMap.StandardKeySet()
Method Detail

iterator

public Iterator<K> iterator()
Specified by:
iterator in interface Iterable<K>
Specified by:
iterator in interface Collection<K>
Specified by:
iterator in interface Set<K>
Specified by:
iterator in class AbstractCollection<K>

size

public int size()
Specified by:
size in interface Collection<K>
Specified by:
size in interface Set<K>
Specified by:
size in class AbstractCollection<K>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<K>
Specified by:
isEmpty in interface Set<K>
Overrides:
isEmpty in class AbstractCollection<K>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<K>
Specified by:
contains in interface Set<K>
Overrides:
contains in class AbstractCollection<K>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<K>
Specified by:
remove in interface Set<K>
Overrides:
remove in class AbstractCollection<K>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<K>
Specified by:
removeAll in interface Set<K>
Overrides:
removeAll in class AbstractSet<K>

clear

public void clear()
Specified by:
clear in interface Collection<K>
Specified by:
clear in interface Set<K>
Overrides:
clear in class AbstractCollection<K>


Copyright © 2010-2012. All Rights Reserved.