com.google.common.collect
Class ForwardingMap.StandardKeySet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<K>
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
ForwardingMap.StandardKeySet
public ForwardingMap.StandardKeySet()
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-2011. All Rights Reserved.