Top Description Fields Constructors Methods
io.vavr.collection

public final Class HashMap<K, V>

extends Object
implements Map<K, V>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, io.vavr.collection.Map, io.vavr.PartialFunction, io.vavr.Function1, java.util.function.Function, io.vavr.collection.Traversable, io.vavr.Value, java.lang.Iterable, io.vavr.collection.Foldable
Imports
io.vavr.Tuple, .Tuple2, io.vavr.control.Option, java.io.Serializable, java.util.ArrayList, .Comparator, .NoSuchElementException, .Objects, java.util.function.*, java.util.stream.Collector

An immutable HashMap implementation based on a Hash array mapped trie (HAMT).
Author
Ruslan Sennov, Patryk Najda, Daniel Dietrich

Field Summary

Modifier and TypeField and Description
private static final HashMap<?, ?>
private static final long
private final HashArrayMappedTrie<K, V>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public <K2, V2> HashMap<K2, V2>
bimap(Function<? super K, ? extends K2>
a Function that maps the keys of type K to keys of type K2
keyMapper
,
Function<? super V, ? extends V2>
a Function that the values of type V to values of type V2
valueMapper
)

Implements io.vavr.collection.Map.bimap.

Maps this Map to a new Map with different component type by applying a function to its elements.

public static <
The key type
K
,
The value type
V
>
Collector<Tuple2<K, V>, ArrayList<Tuple2<K, V>>, HashMap<K, V>>

Returns:

A HashMap Collector.
collector
()

Returns a java.util.stream.Collector which may be used in conjunction with java.util.stream.Stream#collect(java.util.stream.Collector) to obtain a HashMap.

public static <
The key type
K
,
The value type
V
,
Initial java.util.stream.Stream elements type
T extends V
>
Collector<T, ArrayList<T>, HashMap<K, V>>

Returns:

A HashMap Collector.
collector
(Function<? super T, ? extends K>
The key mapper
keyMapper
)

Returns a java.util.stream.Collector which may be used in conjunction with java.util.stream.Stream#collect(java.util.stream.Collector) to obtain a HashMap.

public static <
The key type
K
,
The value type
V
,
Initial java.util.stream.Stream elements type
T
>
Collector<T, ArrayList<T>, HashMap<K, V>>

Returns:

A HashMap Collector.
collector
(Function<? super T, ? extends K>
The key mapper
keyMapper
,
Function<? super T, ? extends V>
The value mapper
valueMapper
)

Returns a java.util.stream.Collector which may be used in conjunction with java.util.stream.Stream#collect(java.util.stream.Collector) to obtain a HashMap.

public Tuple2<V, HashMap<K, V>>
computeIfAbsent(K
key whose presence in this map is to be tested
key
,
Function<? super K, ? extends V>
mapping function
mappingFunction
)

Implements io.vavr.collection.Map.computeIfAbsent.

If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map.

public Tuple2<Option<V>, HashMap<K, V>>
computeIfPresent(K
key whose presence in this map is to be tested
key
,
BiFunction<? super K, ? super V, ? extends V>
remapping function
remappingFunction
)

Implements io.vavr.collection.Map.computeIfPresent.

If the value for the specified key is present, attempts to compute a new mapping given the key and its current mapped value.

public boolean
containsKey(K
key whose presence in this map is to be tested
key
)

Implements io.vavr.collection.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

private HashMap<K, V>
public HashMap<K, V>
distinct()

Implements io.vavr.collection.Map.distinct.

Returns a new version of this which contains no duplicates.

public HashMap<K, V>
distinctBy(Comparator<? super Tuple2<K, V>>
A comparator
comparator
)

Implements io.vavr.collection.Map.distinctBy.

Returns a new version of this which contains no duplicates.

public <U> HashMap<K, V>
distinctBy(Function<? super Tuple2<K, V>, ? extends U>
A key extractor
keyExtractor
)

Implements io.vavr.collection.Map.distinctBy.

Returns a new version of this which contains no duplicates.

public HashMap<K, V>
drop(int
The number of elements to drop.
n
)

Implements io.vavr.collection.Map.drop.

Drops the first n elements of this or all elements, if this length < n.

public HashMap<K, V>
dropRight(int
The number of elements to drop.
n
)

Implements io.vavr.collection.Map.dropRight.

Drops the last n elements of this or all elements, if this length < n.

public HashMap<K, V>
dropUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.Map.dropUntil.

Drops elements until the predicate holds for the current element.

public HashMap<K, V>
dropWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.Map.dropWhile.

Drops elements while the predicate holds for the current element.

public static <K, V> HashMap<K, V>
public boolean
equals(Object
an object, may be null
o
)

Overrides java.lang.Object.equals.

Implements io.vavr.collection.Traversable.equals.

In Vavr there are four basic classes of collections:

  • Seq (sequential elements)
  • Set (distinct elements)
  • Map (indexed elements)
  • Multimap (indexed collections)
public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

An HashMap of size n, where each element contains the result supplied by s.
fill
(int
The number of elements in the HashMap
n
,
Supplier<? extends Tuple2<? extends K, ? extends V>>
The Supplier computing element values
s
)

Returns a HashMap containing tuples returned by n calls to a given Supplier s.

public HashMap<K, V>
filter(BiPredicate<? super K, ? super V>
the predicate used to test elements
predicate
)

Implements io.vavr.collection.Map.filter.

Returns a new Map consisting of all elements which satisfy the given predicate.

public HashMap<K, V>
filter(Predicate<? super Tuple2<K, V>>
A predicate
predicate
)

Implements io.vavr.collection.Map.filter.

Returns a new traversable consisting of all elements which satisfy the given predicate.

public HashMap<K, V>
filterKeys(Predicate<? super K>
the predicate used to test keys of elements
predicate
)

Implements io.vavr.collection.Map.filterKeys.

Returns a new Map consisting of all elements with keys which satisfy the given predicate.

public HashMap<K, V>
filterValues(Predicate<? super V>
the predicate used to test values of elements
predicate
)

Implements io.vavr.collection.Map.filterValues.

Returns a new Map consisting of all elements with values which satisfy the given predicate.

public <K2, V2> HashMap<K2, V2>
flatMap(BiFunction<? super K, ? super V, ? extends Iterable<Tuple2<K2, V2>>>
A mapper
mapper
)

Implements io.vavr.collection.Map.flatMap.

FlatMaps this Map to a new Map with different component type.

public Option<V>
get(K
the key whose associated value is to be returned
key
)

Implements io.vavr.collection.Map.get.

Returns the Some of value to which the specified key is mapped, or None if this map contains no mapping for the key.

public V
getOrElse(K
the key
key
,
V
a default value
defaultValue
)

Implements io.vavr.collection.Map.getOrElse.

Returns the value associated with a key, or a default value if the key is not contained in the map.

public <C> Map<C, HashMap<K, V>>
groupBy(Function<? super Tuple2<K, V>, ? extends C>
A function which classifies elements into classes
classifier
)

Implements io.vavr.collection.Map.groupBy.

Groups this elements by classifying the elements.

public Iterator<HashMap<K, V>>
grouped(int
a positive block size
size
)

Implements io.vavr.collection.Map.grouped.

Groups this Traversable into fixed size blocks.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements io.vavr.collection.Traversable.hashCode.

Returns the hash code of this collection.

public Tuple2<K, V>
head()

Implements io.vavr.collection.Traversable.head.

Returns the first element of a non-empty Traversable.

public HashMap<K, V>
init()

Implements io.vavr.collection.Map.init.

Dual of tail(), returning all elements except the last.

public Option<HashMap<K, V>>
initOption()

Implements io.vavr.collection.Map.initOption.

Dual of tailOption(), returning all elements except the last as Option.

public boolean

Returns:

false
isAsync
()

Implements io.vavr.Value.isAsync.

A HashMap is computed synchronously.

public boolean
isEmpty()

Overrides default io.vavr.collection.Traversable.isEmpty.

Checks if this Traversable is empty.

public boolean

Returns:

false
isLazy
()

Implements io.vavr.Value.isLazy.

A HashMap is computed eagerly.

public Iterator<Tuple2<K, V>>
iterator()

Implements io.vavr.collection.Map.iterator.

An iterator by means of head() and tail().

public Set<K>
keySet()

Implements io.vavr.collection.Map.keySet.

Returns the keys contained in this map.

public Iterator<K>
keysIterator()

Overrides default io.vavr.collection.Map.keysIterator.

Returns the keys contained in this map as an iterator.

public Tuple2<K, V>
last()

Implements io.vavr.collection.Traversable.last.

Dual of head(), returning the last element.

public <K2, V2> HashMap<K2, V2>
map(BiFunction<? super K, ? super V, Tuple2<K2, V2>>
a Function that maps entries of type (K, V) to entries of type (K2, V2)
mapper
)

Implements io.vavr.collection.Map.map.

Maps the entries of this Map to form a new Map.

public <K2> HashMap<K2, V>
mapKeys(Function<? super K, ? extends K2>
a Function that maps keys of type V to keys of type V2
keyMapper
)

Implements io.vavr.collection.Map.mapKeys.

Maps the keys of this Map while preserving the corresponding values.

public <K2> HashMap<K2, V>
mapKeys(Function<? super K, ? extends K2>
a Function that maps keys of type V to keys of type V2
keyMapper
,
BiFunction<? super V, ? super V, ? extends V>
a BiFunction that merges values
valueMerge
)

Implements io.vavr.collection.Map.mapKeys.

Maps the keys of this Map while preserving the corresponding values and applying a value merge function on collisions.

public <V2> HashMap<K, V2>
mapValues(Function<? super V, ? extends V2>
a Function that maps values of type V to values of type V2
valueMapper
)

Implements io.vavr.collection.Map.mapValues.

Maps the values of this Map while preserving the corresponding keys.

public HashMap<K, V>
merge(Map<? extends K, ? extends V>
the other map
that
)

Implements io.vavr.collection.Map.merge.

Creates a new map which by merging the entries of this map and that map.

public <U extends V> HashMap<K, V>
merge(Map<? extends K, U>
the other map
that
,
BiFunction<? super V, ? super U, ? extends V>
the collision resolution function
collisionResolution
)

Implements io.vavr.collection.Map.merge.

Creates a new map which by merging the entries of this map and that map.

public static <
Key type
K
,
Value type
V
>
HashMap<K, V>

Returns:

the given hashMap instance as narrowed type HashMap<K, V>.
narrow
(HashMap<? extends K, ? extends V>
A HashMap.
hashMap
)

Narrows a widened HashMap<?

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entry
of
(Tuple2<? extends K, ? extends V>
A map entry.
entry
)

Returns a singleton HashMap, i.e. a HashMap of one element.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entry
of
(K
A singleton map key.
key
,
V
A singleton map value.
value
)

Returns a singleton HashMap, i.e. a HashMap of one element.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
,
K
a key for the map
k4
,
V
the value for k4
v4
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
,
K
a key for the map
k4
,
V
the value for k4
v4
,
K
a key for the map
k5
,
V
the value for k5
v5
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
,
K
a key for the map
k4
,
V
the value for k4
v4
,
K
a key for the map
k5
,
V
the value for k5
v5
,
K
a key for the map
k6
,
V
the value for k6
v6
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
,
K
a key for the map
k4
,
V
the value for k4
v4
,
K
a key for the map
k5
,
V
the value for k5
v5
,
K
a key for the map
k6
,
V
the value for k6
v6
,
K
a key for the map
k7
,
V
the value for k7
v7
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
,
K
a key for the map
k4
,
V
the value for k4
v4
,
K
a key for the map
k5
,
V
the value for k5
v5
,
K
a key for the map
k6
,
V
the value for k6
v6
,
K
a key for the map
k7
,
V
the value for k7
v7
,
K
a key for the map
k8
,
V
the value for k8
v8
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
,
K
a key for the map
k4
,
V
the value for k4
v4
,
K
a key for the map
k5
,
V
the value for k5
v5
,
K
a key for the map
k6
,
V
the value for k6
v6
,
K
a key for the map
k7
,
V
the value for k7
v7
,
K
a key for the map
k8
,
V
the value for k8
v8
,
K
a key for the map
k9
,
V
the value for k9
v9
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
of
(K
a key for the map
k1
,
V
the value for k1
v1
,
K
a key for the map
k2
,
V
the value for k2
v2
,
K
a key for the map
k3
,
V
the value for k3
v3
,
K
a key for the map
k4
,
V
the value for k4
v4
,
K
a key for the map
k5
,
V
the value for k5
v5
,
K
a key for the map
k6
,
V
the value for k6
v6
,
K
a key for the map
k7
,
V
the value for k7
v7
,
K
a key for the map
k8
,
V
the value for k8
v8
,
K
a key for the map
k9
,
V
the value for k9
v9
,
K
a key for the map
k10
,
V
the value for k10
v10
)

Creates a HashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given map
ofAll
(Map<? extends K, ? extends V>
A map
map
)

Returns a HashMap, from a source java.util.Map.

public static <
The stream element type
T
,
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map
ofAll
(Stream<? extends T>
the source stream
stream
,
Function<? super T, ? extends K>
the key mapper
keyMapper
,
Function<? super T, ? extends V>
the value mapper
valueMapper
)

Returns a HashMap, from entries mapped from stream.

public static <
The stream element type
T
,
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map
ofAll
(Stream<? extends T>
the source stream
stream
,
Function<? super T, Tuple2<? extends K, ? extends V>>
the entry mapper
entryMapper
)

Returns a HashMap, from entries mapped from stream.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
ofEntries
(Map.Entry<? extends K, ? extends V>...
Map entries
entries
)

Creates a HashMap of the given entries.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
ofEntries
(Tuple2<? extends K, ? extends V>...
Map entries
entries
)

Creates a HashMap of the given entries.

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

A new Map containing the given entries
ofEntries
(Iterable<? extends Tuple2<? extends K, ? extends V>>
Map entries
entries
)

Creates a HashMap of the given entries.

public HashMap<K, V>
orElse(Iterable<? extends Tuple2<K, V>>
An alternative Traversable
other
)

Implements io.vavr.collection.Map.orElse.

Returns this Traversable if it is nonempty, otherwise return the alternative.

public HashMap<K, V>
orElse(Supplier<? extends Iterable<? extends Tuple2<K, V>>>
An alternative Traversable supplier
supplier
)

Implements io.vavr.collection.Map.orElse.

Returns this Traversable if it is nonempty, otherwise return the result of evaluating supplier.

public Tuple2<HashMap<K, V>, HashMap<K, V>>
partition(Predicate<? super Tuple2<K, V>>
A predicate which classifies an element if it is in the first or the second traversable.
predicate
)

Implements io.vavr.collection.Map.partition.

Creates a partition of this Traversable by splitting this elements in two in distinct traversables according to a predicate.

public HashMap<K, V>
peek(Consumer<? super Tuple2<K, V>>
The action that will be performed on the element(s).
action
)

Implements io.vavr.collection.Map.peek.

Performs the given action on the first element if this is an eager implementation.

public <U extends V> HashMap<K, V>
put(K
key with which the specified value is to be associated
key
,
U
value to be associated with the specified key
value
,
BiFunction<? super V, ? super U, ? extends V>
function taking the old and new values and merging them.
merge
)

Implements io.vavr.collection.Map.put.

Associates the specified value with the specified key in this map.

public HashMap<K, V>
put(K
key with which the specified value is to be associated
key
,
V
value to be associated with the specified key
value
)

Implements io.vavr.collection.Map.put.

Associates the specified value with the specified key in this map.

public HashMap<K, V>
put(Tuple2<? extends K, ? extends V>
A Tuple2 containing the key and value
entry
)

Implements io.vavr.collection.Map.put.

Convenience method for put(entry._1, entry._2).

public <U extends V> HashMap<K, V>
put(Tuple2<? extends K, U>
A Tuple2 containing the key and value
entry
,
BiFunction<? super V, ? super U, ? extends V>
function taking the old and new values and merging them.
merge
)

Implements io.vavr.collection.Map.put, io.vavr.collection.Map.put.

Convenience method for put(entry._1, entry._2, merge).

private Object
public HashMap<K, V>
reject(BiPredicate<? super K, ? super V>
the predicate used to test elements
predicate
)

Implements io.vavr.collection.Map.reject.

Returns a new Map consisting of all elements which do not satisfy the given predicate.

public HashMap<K, V>
reject(Predicate<? super Tuple2<K, V>>
A predicate
predicate
)

Implements io.vavr.collection.Map.reject.

Returns a new traversable consisting of all elements which do not satisfy the given predicate.

public HashMap<K, V>
rejectKeys(Predicate<? super K>
the predicate used to test keys of elements
predicate
)

Implements io.vavr.collection.Map.rejectKeys.

Returns a new Map consisting of all elements with keys which do not satisfy the given predicate.

public HashMap<K, V>
rejectValues(Predicate<? super V>
the predicate used to test values of elements
predicate
)

Implements io.vavr.collection.Map.rejectValues.

Returns a new Map consisting of all elements with values which do not satisfy the given predicate.

public HashMap<K, V>
remove(K
key whose mapping is to be removed from the map
key
)

Implements io.vavr.collection.Map.remove.

Removes the mapping for a key from this map if it is present.

public HashMap<K, V>
removeAll(BiPredicate<? super K, ? super V>
the predicate used to test elements
predicate
)

Implements io.vavr.collection.Map.removeAll.

Deprecated

Returns a new Map consisting of all elements which do not satisfy the given predicate.

public HashMap<K, V>
removeAll(Iterable<? extends K>
keys are to be removed from the map
keys
)

Implements io.vavr.collection.Map.removeAll.

Removes the mapping for a key from this map if it is present.

public HashMap<K, V>
removeKeys(Predicate<? super K>
the predicate used to test keys of elements
predicate
)

Implements io.vavr.collection.Map.removeKeys.

Deprecated

Returns a new Map consisting of all elements with keys which do not satisfy the given predicate.

public HashMap<K, V>
removeValues(Predicate<? super V>
the predicate used to test values of elements
predicate
)

Implements io.vavr.collection.Map.removeValues.

Deprecated

Returns a new Map consisting of all elements with values which do not satisfy the given predicate.

public HashMap<K, V>
replace(Tuple2<K, V>
An element to be substituted.
currentElement
,
Tuple2<K, V>
A replacement for currentElement.
newElement
)

Implements io.vavr.collection.Map.replace.

Replaces the first occurrence (if exists) of the given currentElement with newElement.

public HashMap<K, V>
replace(K
the key of the element to be substituted.
key
,
V
the expected current value that the key is currently mapped to
oldValue
,
V
the new value to be associated with the key
newValue
)

Implements io.vavr.collection.Map.replace.

Replaces the entry for the specified key only if currently mapped to the specified value.

public HashMap<K, V>
replaceAll(Tuple2<K, V>
An element to be substituted.
currentElement
,
Tuple2<K, V>
A replacement for currentElement.
newElement
)

Implements io.vavr.collection.Map.replaceAll.

Replaces all occurrences of the given currentElement with newElement.

public HashMap<K, V>
replaceAll(BiFunction<? super K, ? super V, ? extends V>
function transforming key and current value to a new value
function
)

Implements io.vavr.collection.Map.replaceAll.

Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.

public HashMap<K, V>
replaceValue(K
the key of the element to be substituted.
key
,
V
the new value to be associated with the key
value
)

Implements io.vavr.collection.Map.replaceValue.

Replaces the entry for the specified key only if it is currently mapped to some value.

public HashMap<K, V>
retainAll(Iterable<? extends Tuple2<K, V>>
Elements to be kept.
elements
)

Implements io.vavr.collection.Map.retainAll.

Keeps all occurrences of the given elements from this.

public HashMap<K, V>
scan(Tuple2<K, V>
neutral element for the operator op
zero
,
BiFunction<? super Tuple2<K, V>, ? super Tuple2<K, V>, ? extends Tuple2<K, V>>
the associative operator for the scan
operation
)

Implements io.vavr.collection.Map.scan.

Computes a prefix scan of the elements of the collection.

public int
size()

Implements io.vavr.collection.Map.size.

Computes the number of elements of this Traversable.

public Iterator<HashMap<K, V>>
slideBy(Function<? super Tuple2<K, V>, ?>
A function which classifies elements into classes
classifier
)

Implements io.vavr.collection.Map.slideBy.

Slides a non-overlapping window of a variable size over this Traversable.

public Iterator<HashMap<K, V>>
sliding(int
a positive window size
size
)

Implements io.vavr.collection.Map.sliding.

Slides a window of a specific size and step size 1 over this Traversable by calling sliding(int, int).

public Iterator<HashMap<K, V>>
sliding(int
a positive window size
size
,
int
a positive step size
step
)

Implements io.vavr.collection.Map.sliding.

Slides a window of a specific size and step size over this Traversable.

public Tuple2<HashMap<K, V>, HashMap<K, V>>
span(Predicate<? super Tuple2<K, V>>
A predicate.
predicate
)

Implements io.vavr.collection.Map.span.

Returns a tuple where the first element is the longest prefix of elements that satisfy the given predicate and the second element is the remainder.

public String
stringPrefix()

Implements io.vavr.Value.stringPrefix.

Returns the name of this Value type, which is used by toString().

public static <
The key type
K
,
The value type
V
>
HashMap<K, V>

Returns:

An HashMap consisting of elements f(0),f(1), ..., f(n - 1)
tabulate
(int
The number of elements in the HashMap
n
,
Function<? super Integer, ? extends Tuple2<? extends K, ? extends V>>
The Function computing element values
f
)

Returns an HashMap containing n values of a given Function f over a range of integer values from 0 to n - 1.

public HashMap<K, V>
tail()

Implements io.vavr.collection.Map.tail.

Drops the first element of a non-empty Traversable.

public Option<HashMap<K, V>>
tailOption()

Implements io.vavr.collection.Map.tailOption.

Drops the first element of a non-empty Traversable and returns an Option.

public HashMap<K, V>
take(int
The number of elements to take.
n
)

Implements io.vavr.collection.Map.take.

Takes the first n elements of this or all elements, if this length < n.

public HashMap<K, V>
takeRight(int
The number of elements to take.
n
)

Implements io.vavr.collection.Map.takeRight.

Takes the last n elements of this or all elements, if this length < n.

public HashMap<K, V>
takeUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.Map.takeUntil.

Takes elements until the predicate holds for the current element.

public HashMap<K, V>
takeWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for the contained elements.
predicate
)

Implements io.vavr.collection.Map.takeWhile.

Takes elements while the predicate holds for the current element.

public HashMap<K, V>
toJavaMap()

Implements io.vavr.collection.Map.toJavaMap.

Converts this Vavr Map to a java.util.Map while preserving characteristics like insertion order (LinkedHashMap) and sort order (SortedMap).

public String
toString()

Overrides java.lang.Object.toString.

Implements io.vavr.Value.toString.

Clarifies that values have a proper toString() method implemented.

public Stream<V>
values()

Implements io.vavr.collection.Map.values.

Returns a new Seq that contains the values of this Map.

public Iterator<V>
valuesIterator()

Overrides default io.vavr.collection.Map.valuesIterator.

Returns the values in this map.

private static <K, V> HashMap<K, V>
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait