An map-like iterable
object to conver to a KoconutMap.
Returns a KoconutSet contains every Entry.
Returns a KoconutSet contains all keys.
Returns the number of Entry in this KoconutMap.
Returns a KoconutArray contains all values in this KoconutMap.
Returns the number of the elements matching the given predicate
. If the predicate
is ommitted it'll returns the whole number of elements.
A callback function that accepts an argument. The method calls the predicate
one time for each element in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Returns the first entry yielding the largest value of the given function or throws KoconutNoSuchElementException if there are no entries.
A callback function that accepts an argument. The method calls the selector
one time for each entry in object.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
Returns the first entry yielding the largest value of the given function or null if there are no entries.
A callback function that accepts an argument. The method calls the selector
one time for each entry in object.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
Returns the largest value among all values produced by selector
function applied to each element in the collection or
throws KoconutNoSuchElementException if there are no elements.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
Returns the largest value among all values produced by selector
function applied to each element in the collection or
null if there are no elements.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
Returns the largest value according to the provided comparator
among all values
produced by selector
function applied to each element in the collection all throws KoconutNoSuchElementException
if elements are empty.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
A callback function that accepts two arguements. The method calls the comparator
to compare two selected values.
In case the result is larger than 0, front is bigger than rear, and if it's less than 0 judge vice versa.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Returns the largest value according to the provided comparator
among all values
produced by selector
function applied to each element in the collection or null
if elements are empty.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
A callback function that accepts two arguements. The method calls the comparator
to compare two selected values.
In case the result is larger than 0, front is bigger than rear, and if it's less than 0 judge vice versa.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Returns the first element having the largest value according to the provided comparator
or throws KoconutNoSuchElementException
if elements are empty.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Returns the first element having the largest value according to the provided comparator
or null
if elements are empty.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Returns the first entry yielding the samllest value of the given function or throws KoconutNoSuchElementException if there are no entries.
A callback function that accepts an argument. The method calls the selector
one time for each entry in object.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
Returns the first entry yielding the samllest value of the given function or null
if there are no entries.
A callback function that accepts an argument. The method calls the selector
one time for each entry in object.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
Returns the smallest value among all values produced by selector
function applied to each element in the collection or
throws KoconutNoSuchElementException if there are no elements.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
Returns the smallest value among all values produced by selector
function applied to each element in the collection or
null
if there are no elements.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
Returns the smallest value according to the provided comparator
among all values
produced by selector
function applied to each element in the collection all throws KoconutNoSuchElementException
if elements are empty.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
A callback function that accepts two arguements. The method calls the comparator
to compare two selected values.
In case the result is larger than 0, front is bigger than rear, and if it's less than 0 judge vice versa.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Returns the smallest value according to the provided comparator
among all values
produced by selector
function applied to each element in the collection all null
if elements are empty.
A callback function that accepts an argument. The method calls the selector
one time for each element in object.
A callback function that accepts two arguements. The method calls the comparator
to compare two selected values.
In case the result is larger than 0, front is bigger than rear, and if it's less than 0 judge vice versa.
An object to which the this
keyword can refer in the selector
. If thisArg
is omitted, null
is used as the this
value.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Returns the first element having the smallest value according to the provided comparator
or throws KoconutNoSuchElementException
if elements are empty.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Returns the first element having the smallest value according to the provided comparator
or null
if elements are empty.
An object to which the this
keyword can refer in the comparator
. If thisArg
is omitted, null
is used as the this
value.
Creates an KoconutArray instance that wraps original data.
Creates an KoconutSet instance that wraps original data.
Creates a new instance from iterable
object.
Inner data type colud be an Array
of two values([Key
, Value
]), a Pair or an Entry.
An map-like iterable
object to conver to a KoconutMap.
Creates a new instance with given count
as number of entries. count
cannot be negative number.
Each entry is provided from generator
with given ordered index.
Number of values.
A callback function that accepts an argument. The method calls the action
one time for each ordered index.
An object to which the this
keyword can refer in the generator
. If thisArg
is omitted, null
is used as the this
value.
Creates a new instance from variable number of arguments.
Inner data type colud be an Array
of two values([Key
, Value
]), a Pair or an Entry.
A set of elements to include in the new KoconutMap object.
Return true
if all elements match te given predicate
.
A callback function that accepts an argument. The method calls the predicate
one time for each element in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Returns true
if the collection has at least one element matches the given predicate
.
A callback function that accepts an argument. The method calls the predicate
one time for each element in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Checks if this KoconutMap contains the given key
.
Key to search for.
Checks if this KoconutMap contains the given key
.
Key to search for.
Checks if this KoconutMap contains given value
.
Value to search for.
Returns true
if the collection is empty (contains no elements), false
otherwise.
Returns true
if the collection is not empty.
Returns true
if this nullable collection is either null or empty.
predicate
callback function is optional. If it's omitted the method returns true
if the collection has no elements.
Otherwise, returns true
if no elements match the given predicate
.
A callback function that accepts an argument. The method calls the predicate
one time for each element in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Performs the given action
on each element.
When you want to stop iteration in the meantime return
false
or KoconutLoopSignal.BREAK.
A callback function that accepts an argument. The method calls the action
one time for each element in object.
An object to which the this
keyword can refer in the action
. If thisArg
is omitted, null
is used as the this
value.
Perfroms the given action
on each entry and returns the original collection itself afterwards.
When you want to stop iteration in the meantime return
false
or KoconutLoopSignal.BREAK.
A callback function that accepts an argument. The method calls the action
one time for each entry in object.
An object to which the this
keyword can refer in the action
. If thisArg
is omitted, null
is used as the this
value.
Returns a map containing only entries matching the given predicate
.
A callback function that accepts an argument. The method calls the predicate
one time for each entry in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Returns a map containing all entries with key matching the given predicate
.
A callback function that accepts an argument. The method calls the predicate
one time for each entry in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Returns a map containing only entries not matching the given predicate
.
A callback function that accepts an argument. The method calls the predicate
one time for each entry in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Appends all entries not matching the given predicate
to the given destination.
Iterable destinaion. Map
to be exact.
A callback function that accepts an argument. The method calls the predicate
one time for each entry in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Appends all entries matching the given predicate
to the given destination.
Iterable destinaion. Map
to be exact.
A callback function that accepts an argument. The method calls the predicate
one time for each entry in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Returns a map containing all entries with value matching the given predicate
.
A callback function that accepts an argument. The method calls the predicate
one time for each entry in object.
An object to which the this
keyword can refer in the predicate
. If thisArg
is omitted, null
is used as the this
value.
Returns a KoconutMap containing all entires of the original map except
the entries the keys of which are contained in keys
.
Key data to except. It could be plural or singular.
Returns a KoconutMap by replacing or adding entries from given entries
.
Entires to add or replace. It could be plural or singular.
Processes all the chained objects and calls the specified function
block
with the result value as its argument and returns the original result.
A callback function that accepts an argument.
Processes all the chained objects and calls the specified function
block
with the result value as its argument and returns the final result
of the block
.
A callback function that accepts an argument. The method calls the block
and returns its result.
Processes all the chained objects ane returns Promise<void>
.
Processes all the chained object and returns original KoconutMap instance.
Processes all the chained objects and return the result.
Returns the value corresponding to the given key
, or null
if such a key is not
present in this KoconutMap.
Key to search for.
Returns the value to which the specified key is mapped, or defaultValue
if the map contains
no mapping for key.
Key to search for.
Default value if no entry is found.
Returns the value for the given key
, or the reuslt of the
defaultValue
function if there was no entry from the given key.
Key to search for.
Callback function that generates default value. The method will call defaultValue
if no entry is found.
Returns the value of the given key. If no entry is found, it throws KoconutNoSuchElementException.
Key to search for.
Returns a single list of all elements yielded from results of transform
function being invoked on each element of original collection.
A callback function that accepts an argument. The method calls the transform
one time for each element in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Appends all entries yielded from results of transform
function being invoked
on each entry of original collection, to the given destination
.
Iterable destinaion. Array
or Set
to be exact.
A callback function that accepts an argument. The method calls the transform
one time for each entry in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Returns a list containing the results of applying the given transform
function
to each element in the original collection.
A callback function that accepts an argument. The method calls the transform
one time for each element in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Returns a new Map
with entries having the keys obatined by applying the
transform
function to each entry in this object. The value of each of them would be the same
as the original entry.
A callback function that accepts an argument. The method calls the transform
one time for each entry in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Populates the given destination
map with entries having keys obtained by applying
the transform
function to each entry in this object. The value of each of them would be the same
as the original entry.
Iterable destinaion. Map
to be exact.
A callback function that accepts an argument. The method calls the transform
one time for each entry in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Returns a list containing results that are not null
nor undefined
of applying
the given transfrom
function to each element in the original collection. You can use this method as filter
then map
.
A callback function that accepts an argument. The method calls the transform
one time for each element in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Applies the given transform
function to each entry of the original collection
and appends the results to the given destination
.
Iterable destinaion. Array
or Set
to be exact.
A callback function that accepts an argument. The method calls the transform
one time for each entry in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Applies the given transform
function to each entry of the original collection
and appends the results to the given destination
.
Iterable destinaion. Array
or Set
to be exact.
A callback function that accepts an argument. The method calls the transform
one time for each element in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Populates the given destinaion
Map
with the entires having the keys of this object and
the values obtained by applying the transform
function to each entry.
Iterable destinaion. Map
to be exact.
A callback function that accepts an argument. The method calls the transform
one time for each entry in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Returns a new Map
with entries having the keys of this object and the values obtained by applying
the transform
function to each entry.
A callback function that accepts an argument. The method calls the transform
one time for each entry in object.
An object to which the this
keyword can refer in the transform
. If thisArg
is omitted, null
is used as the this
value.
Generated using TypeDoc
Creates a new instance from
iterable
object. Inner data type colud be anArray
of two values([Key
,Value
]), a Pair or an Entry.1.0.11
const stringAndNumberMap = new Map([ ["a", 1], ["b", 2], ["c", 3] ]) const stringAndNumber1 = new KoconutMap(stringAndNumberMap) // ↑ This is a Koconut string - number paired map. const stringAndNumber2 = new KoconutMap([ ["a", 1], new Pair("b", 2), new Entry("c", 3) ]) // ↑ This is a Koconut string - number paired map, too. const emptyStringAndNumberMap = new KoconutMap<string, number>() // ↑ This is an empty Koconut string - number paired map.