K - the key typeV - the value typepublic static class ImmutableMap.ValueCollection<K,V> extends ImmutableCollectionBase<ImmutableMapEntry<K,V>,V> implements Collection<V>
Collection interface to provide a view of the values in the ImmutableMap.
It makes use of the same underlying array, but returns only the value portion of the ImmutableMapEntry.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Object o)
Test whether the collection contains an element equal to the specified object (which may be
null). |
V |
get(int index)
Get the value at the specified index.
|
Iterator<V> |
iterator()
Return an
Iterator over the collection. |
Object[] |
toArray()
Create a copy of the collection in an array.
|
<T> T[] |
toArray(T[] a)
Return a copy of the collection, either in the supplied array (if it fits) or in a new array of the specified
type.
|
add, addAll, containsAll, remove, removeAll, retainAll, toStringclear, isEmpty, sizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, streampublic boolean contains(Object o)
null).contains in interface Collection<V>o - the valuetrue if the collection contains the objectpublic Object[] toArray()
toArray in interface Collection<V>public <T> T[] toArray(T[] a)
toArray in interface Collection<V>T - the type of the destination array itemsa - the destination arrayArrayStoreException - if the values in the map can't be stored in the destination arraypublic V get(int index)
Collection interface, but it
allows iteration over the entries of a map without needing to instantiate an Iterator.
index - the indexIndexOutOfBoundsException - if the index is less than 0 or greater than the length of the listCopyright © 2023. All rights reserved.