Package com.google.common.collect
Class ForwardingMap.StandardValues
- java.lang.Object
-
- java.util.AbstractCollection<V>
-
- com.google.common.collect.ForwardingMap.StandardValues
-
- All Implemented Interfaces:
java.lang.Iterable<V>
,java.util.Collection<V>
- Enclosing class:
- ForwardingMap<K,V>
@Beta protected class ForwardingMap.StandardValues extends java.util.AbstractCollection<V>
A sensible implementation ofMap.values()
in terms of the following methods:ForwardingMap.clear()
,ForwardingMap.containsValue(java.lang.Object)
,ForwardingMap.isEmpty()
,ForwardingMap.size()
, and theSet.iterator()
method ofForwardingMap.entrySet()
. In many cases, you may wish to overrideForwardingMap.values()
to forward to this implementation or a subclass thereof.- Since:
- 10.0
-
-
Constructor Summary
Constructors Constructor Description StandardValues()
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
contains(java.lang.Object o)
boolean
isEmpty()
java.util.Iterator<V>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
-
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
iterator
public java.util.Iterator<V> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<K>
- Specified by:
iterator
in interfacejava.lang.Iterable<K>
- Specified by:
iterator
in classjava.util.AbstractCollection<V>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<K>
- Overrides:
remove
in classjava.util.AbstractCollection<V>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<K>
- Overrides:
removeAll
in classjava.util.AbstractCollection<V>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<K>
- Overrides:
retainAll
in classjava.util.AbstractCollection<V>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<K>
- Specified by:
size
in classjava.util.AbstractCollection<V>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<K>
- Overrides:
isEmpty
in classjava.util.AbstractCollection<V>
-
contains
public boolean contains(@Nullable java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<K>
- Overrides:
contains
in classjava.util.AbstractCollection<V>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<K>
- Overrides:
clear
in classjava.util.AbstractCollection<V>
-
-