Collections.
yarn add @jamashita/lluvia
> node -v
v20.12.2
> npm -v
10.5.0
> yarn -v
1.22.21
git cz
This interface represents a collection Set<V>
. It means, Unique values can be stored in this collection instance. If
the value implements the hashCode()
method from @jamashita/anden
, the value will be stored by its hash code. In case
of hash code conflicts, the previous value will be overwritten. This interface extends the ReadonlyAddress<V>
.
Adds the given value
to the collection.
(override) Address.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, void>): Address<W>
This is an overridden version of the ReadonlyAddress.prototype.filter(predicate)
.
This is an overridden version of the ReadonlyAddress.prototype.map(mapping)
.
Removes the value that matches the given value
from the collection.
This is an immutable class that implements Address<V>
. It does not allow adding or removing values from the
collection directly, but instead returns a new instance of the collection with the added or removed values.
Takes a ReadonlyAddress<PromiseLike<V>>
and returns a single Promise<ImmutableAddress<V>>
that resolves with a new
instance of ImmutableAddress<V>
containing the resolved values.
Returns an empty ImmutableAddress<V>
.
Generates a new instance of ImmutableAddress<V>
from the given collection
.
Generates a new instance of ImmutableAddress<V>
from the given set
.
Adds the given value
to a new instance of ImmutableAddress<V>
, instead of the current collection instance, and then
returns the new instance.
(override) ImmutableAddress.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, void>): ImmutableAddress<W>
(override) ImmutableAddress.prototype.filter(predicate: BinaryPredicate<V, void>): ImmutableAddress<V>
This is an overridden version of the Address.prototype.filter(predicate)
.
This is an overridden version of the Address.prototype.map(mapping)
.
Creates a new instance of ImmutableAddress<V>
by removing the value that matches the given value
from the current
collection instance and then returns the new instance.
This is a mutable class that implements Address. It allows adding and removing values from the collection.
Takes a ReadonlyAddress<PromiseLike<V>>
and returns a single Promise<MutableAddress<V>>
that resolves with a new
instance of MutableAddress<V>
containing the resolved values.
Returns an empty MutableAddress<V>
.
Generates a new instance of MutableAddress<V>
from the given collection
.
Generates a new instance of MutableAddress<V>
from the given set
.
Adds the given value
to the current collection instance and returns the current instance itself.
(override) MutableAddress.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, void>): MutableAddress<W>
This is an overridden version of the Address.prototype.filter(predicate)
.
This is an overridden version of the Address.prototype.map(mapping)
.
Removes the value that matches the given value
from the collection and returns the current instance itself.
This interface represents a read-only version of a Set<V>
collection, meaning that values cannot be added or modified
within the collection instance. If the value implements the hashCode()
method from @jamashita/anden
, the value will
be stored based on its hash code. In case of hash code conflicts, the previous value will be overwritten. This interface
extends Collection<void, V>
.
(override) ReadonlyAddress.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, void>): ReadonlyAddress<W>
(override) ReadonlyAddress.prototype.filter(predicate: BinaryPredicate<V, void>): ReadonlyAddress<V>
This is an overridden version of the Collection.prototype.filter(predicate)
.
This is an overridden version of the Collection.prototype.map(mapping)
.
Returns true
if the given value
is contained in the collection.
Returns a new Set<V>
containing all the values in the collection.
The common interface for Sequence<V>
, Dictionary<K, V>
and Address<V>
. This interface provides common methods for
manipulating multiple data. K
represents the key of the collection and V
represents the value of the collection.
This interface also extends Iterable<[K, V]>
.
This method is invoked by the for-of
loop. It allows iteration through the key-value pairs of the collection as
tuples.
Returns true
if the given value
is contained within this collection instance.
Returns true
if every item in the collection satisfies the given predicate
.
Collection.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, K>): Collection<K, W>
Returns a new collection containing only the items that satisfy the given predicate
. The type of items in the new
collection depends on whether the predicate
is narrowing or not.
Returns the first value that satisfies the given predicate
. If there are no items that satisfy the predicate
,
returns null
.
Iterates through each item and applies the provided foreach
once.
Returns the value of the specified key
. If there is no value, return null
.
Returns true
if this collection has no items.
Returns an iterator that iterates over the key-value pairs in the collection.
Applies the provided mapping
to every item and updates the values to the returned result of the mapping
.
Returns the number of items in the collection.
Returns true
if at least one item in the collection satisfies the given predicate
.
Returns an iterator that iterates over the values in the collection.
This interface represents a collection Map<K, V>
. If the key implements hasCode()
method
from @jamashita/anden
, the value will be able to stored by its hash code.
In case of hash codes conflict, the previous value will be overwritten. This interface extends ReadonlyDictionary<V>
.
(override) Dictionary.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, K>): Dictionary<K, W>
This is an overridden version of the ReadonlyDictionary.prototype.filter(predicate)
.
This is an overridden version of the ReadonlyDictionary.prototype.map(mapping)
.
Removes the value that matches the given key
from the collection.
Sets or updates the given value
to the specified key
in the collection.
This is an immutable class that implements Dictionary<K, V>
. It does not allow adding or removing entries from the
collection directly, but instead returns a new instance of the collection with the added or removed entries.
ImmutableDictionary.await<K, V>(dictionary: ReadonlyDictionary<K, PromiseLike<V>>): Promise<ImmutableDictionary<K, V>>
Takes a ReadonlyDictionary<K, PromiseLike<V>>
and return a single Promise<ImmutableDictionary<K, V>>
that resolves
with a new instance of ImmutableDictionary<K, V>
containing the resolved values.
Returns an empty ImmutableDictionary<K, V>
.
Generates a new instance of ImmutableDictionary<K, V>
from the given collection
.
Generates a new instance of ImmutableDictionary<K, V>
from the given map
.
(override) ImmutableDictionary.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, K>): ImmutableDictionary<K, W>
(override) ImmutableDictionary.prototype.filter(predicate: BinaryPredicate<V, K>): ImmutableDictionary<K, V>
This is an overridden version of the Dictionary.prototype.filter(predicate)
.
This is an overridden version of the Dictionary.prototype.map(mapping)
.
Creates a new instance of ImmutableDictionary<K, V>
by removing the entry that matches the given key
from the
current collection instance and then returns the new instance.
Sets or updates the given value
for the specified key
in a new instance of ImmutableDictionary<K, V>
, instead of
the current collection instance, and returns the new instance.
This is an mutable class that implements Dictionary<K, V>
.
MutableDictionary.await<K, V>(dictionary: ReadonlyDictionary<K, PromiseLike<V>>): Promise<MutableDictionary<K, V>>
Takes a ReadonlyDictionary<K, PromiseLike<V>>
and returns a single Promise<MutableDictionary<K, V>>
that resolves
with a new instance of MutableDictionary<K, V>
containing the resolved values.
Returns an empty MutableDictionary<K, V>
.
Generates a new instance of MutableDictionary<K, V>
from the given collection
.
Generates a new instance of MutableDictionary<K, V>
from the given map
.
(override) MutableDictionary.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, K>): MutableDictionary<K, W>
(override) MutableDictionary.prototype.filter(predicate: BinaryPredicate<V, K>): MutableDictionary<K, V>
This is an overridden version of the Dictionary.prototype.filter(predicate)
.
This is an overridden version of the Dictionary.prototype.map(mapping)
.
Removes entry that matches the given key
from the collection and returns the current instance itself.
Sets or updates the given value
for the specified key
to the current collection instance and returns the current
instance itself.
This interface represents a read-only version of a Map<K, V>
collection, which means that values cannot be added or
modified within the collection instance. If the value implements hasCode()
method from @jamashita/anden
, the entry
will be able to stored by its hash code. In case of hash codes conflict, the previous entry will be overwritten. This
interface extends Collection<K, V>
.
(override) ReadonlyDictionary.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, void>): ReadonlyDictionary<K, W>
(override) ReadonlyDictionary.prototype.filter(predicate: BinaryPredicate<V, void>): ReadonlyDictionary<K, V>
This is an overridden version of the Collection.prototype.filter(predicate)
.
Returns true
if the given key
is contained in the collection.
Returns an iterator that iterates over the keys in the collection.
This is an overridden version of the Collection.prototype.map(mapping)
.
Returns a new Map<K, V>
containing all the entries in the collection.
This is an immutable class that implements Sequence<V>
.
ImmutableSequecne.await<V>(sequence: ReadonlySequence<PromiseLike<V>>): Promise<ImmutableSequence<V>>
Takes a ReadonlySequence<PromiseLike<V>>
and return a single Promise<ImmutableSequence<V>>
.
Returns an empty ImmutableSequence<V>
.
Generates a new instance of ImmutableSequence<V>
from the given collection
.
Generates a new instance of MutableSequence<V>
from the given array
.
Adds the given value
to a new instance of ImmutableSequence<V>
, instead of the current collection instance, and then
returns the new instance.
(override) ImmutableSequence.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, number>): ImmutableSequence<W>
(override) ImmutableSequence.prototype.filter(predicate: BinaryPredicate<V, number>): ImmutableSequence<W>
This is an overridden version of the Sequence.prototype.filter(predicate)
.
This is an overridden version of the Sequence.prototype.map(mapping)
.
Creates a new instance of ImmutableSequence<V>
by removing the value that matches the given key
from the
current collection instance and then returns the new instance.
Sets or updates the given value
for the specified key
in a new instance of ImmutableSequence<V>
instead of the
This is an mutable class that implements Sequence<V>
.
Takes a ReadonlySequence<PromiseLike<V>>
and return a single Promise<MutableSequence<V>>
.
Returns an empty MutableSequence<V>
.
Generates a new instance of MutableSequence<V>
from the given collection
.
Generates a new instance of MutableSequence<V>
from the given array
.
Adds the given value
to the current collection instance and returns the current instance itself.
(override) MutableSequence.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, number>): MutableSequence<W>
(override) MutableSequence.prototype.filter(predicate: BinaryPredicate<V, number>): MutableSequence<W>
This is an overridden version of the Sequence.prototype.filter(predicate)
.
This is an overridden version of the Sequence.prototype.map(mapping)
.
Removes value that matches the given value
from the collection and returns the current instance itself.
Sets or updates the given value
for the specified key
to the current collection instance and returns the current
instance itself.
This interface represents a read-only version of a Array<V>
collection, which means that values cannot be added or
modified within the collection instance. This interface extends Collection<number, V>
.
(override) ReadonlySequence.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, number>): ReadonlySequence<W>
(override) ReadonlySequence.prototype.filter(predicate: BinaryPredicate<V, number>): ReadonlySequence<W>
This is an overridden version of the Collection.prototype.filter(predicate)
.
This is an overridden version of the Collection.prototype.map(mapping)
.
Executes the given reducer
on each item of this instance, passing in the return value from the calculation on the
preceding item. The final result will be a single value. The initialValue
is an optional parameter that can be used as
a starting point for the reduction.
Returns a new instance of ReadonlySequence<V>
sorted according to the given comparator
.
Returns a new Array<V>
containing all the values in the collection.
This interface represents a collection Array<V>
. This interface extends ReadonlySequence<V>
.
Adds the given value
to the collection.
(override) Sequence.prototype.filter<W extends V>(predicate: NarrowingBinaryPredicate<V, W, number>): Sequence<W>
This is an overridden version of the ReadonlySequence.prototype.filter(predicate)
.
This is an overridden version of the ReadonlySequence.prototype.map(mapping)
.
Removes the value at the specified key
from the collection.
Sets or updates the given value
at the specified key
in the collection.
A typical tree that can contain below 2 kinds of data.
An interface that can be into string.
An interface that can be closure table.
A concrete class which nodes are SerializablieTreeObject
.
A concrete class which nodes are StructurableTreeObject
.