Top Description Fields Constructors Methods
io.vavr.collection

public final Class LinkedHashMap<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, .Objects, java.util.function.*, java.util.stream.Collector

An immutable LinkedHashMap implementation that has predictable (insertion-order) iteration.
Author
Ruslan Sennov

Field Summary

Modifier and TypeField and Description
private static final LinkedHashMap<?, ?>
private final Queue<Tuple2<K, V>>
private final HashMap<K, V>
private static final long

Constructor Summary

AccessConstructor and Description
private
LinkedHashMap(Queue<Tuple2<K, V>> list, HashMap<K, V> map)

Method Summary

Modifier and TypeMethod and Description
public <K2, V2> LinkedHashMap<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>>, LinkedHashMap<K, V>>

Returns:

A LinkedHashMap 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 LinkedHashMap.

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

Returns:

A LinkedHashMap 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 LinkedHashMap.

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

Returns:

A LinkedHashMap 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 LinkedHashMap.

public Tuple2<V, LinkedHashMap<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>, LinkedHashMap<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 LinkedHashMap<K, V>
public LinkedHashMap<K, V>
distinct()

Implements io.vavr.collection.Map.distinct.

Returns a new version of this which contains no duplicates.

public LinkedHashMap<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> LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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> LinkedHashMap<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
>
LinkedHashMap<K, V>

Returns:

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

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

public LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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> LinkedHashMap<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, LinkedHashMap<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<LinkedHashMap<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 LinkedHashMap<K, V>
init()

Implements io.vavr.collection.Map.init.

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

public Option<LinkedHashMap<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.

An LinkedHashMap's value 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.

An LinkedHashMap's value is computed eagerly.

public boolean
isSequential()

Overrides default io.vavr.collection.Traversable.isSequential.

Checks if the elements of this Traversable appear in encounter order.

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 Tuple2<K, V>
last()

Implements io.vavr.collection.Traversable.last.

Dual of head(), returning the last element.

public <K2, V2> LinkedHashMap<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> LinkedHashMap<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> LinkedHashMap<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 <W> LinkedHashMap<K, W>
mapValues(Function<? super V, ? extends W>
a Function that maps values of type V to values of type V2
mapper
)

Implements io.vavr.collection.Map.mapValues.

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

public LinkedHashMap<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> LinkedHashMap<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
>
LinkedHashMap<K, V>

Returns:

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

Narrows a widened LinkedHashMap<?

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

Returns:

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

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

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap, i.e. a LinkedHashMap of one element.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

public static <
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap of the given list of key-value pairs.

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

Returns:

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

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

public static <
The stream element type
T
,
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap, from entries mapped from stream.

public static <
The stream element type
T
,
The key type
K
,
The value type
V
>
LinkedHashMap<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 LinkedHashMap, from entries mapped from stream.

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

Returns:

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

Creates a LinkedHashMap of the given entries.

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

Returns:

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

Creates a LinkedHashMap of the given entries.

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

Returns:

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

Creates a LinkedHashMap of the given entries.

public LinkedHashMap<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 LinkedHashMap<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<LinkedHashMap<K, V>, LinkedHashMap<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 LinkedHashMap<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> LinkedHashMap<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 LinkedHashMap<K, V>

Returns:

A new Map containing these elements and that entry.
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 LinkedHashMap<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> LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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<LinkedHashMap<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<LinkedHashMap<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<LinkedHashMap<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<LinkedHashMap<K, V>, LinkedHashMap<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
>
LinkedHashMap<K, V>

Returns:

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

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

public LinkedHashMap<K, V>
tail()

Implements io.vavr.collection.Map.tail.

Drops the first element of a non-empty Traversable.

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

Implements io.vavr.collection.Map.tailOption.

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

public LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 LinkedHashMap<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 Seq<V>
values()

Implements io.vavr.collection.Map.values.

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

private static <
The key type
K
,
The value type
V
>
LinkedHashMap<K, V>

Returns:

A new Map containing the given map with given key order
wrap
(Queue<Tuple2<K, V>>
The list of key-value tuples with unique keys.
list
,
HashMap<K, V>
The map of key-value tuples.
map
)

Construct Map with given values and key order.

private static <
The key type
K
,
The value type
V
>
LinkedHashMap<K, V>

Returns:

A new Map containing the given map with given key order
wrapNonUnique
(Queue<Tuple2<K, V>>
The list of key-value tuples with non-unique keys.
list
,
HashMap<K, V>
The map of key-value tuples.
map
)

Construct Map with given values and key order.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait