FunctionMapJournal is a case class that represents a specialized implementation of AbstractMapJournal, which maintains a journal of key-value pairs along with a function that can derive values based on keys. It extends both AbstractMapJournal and FunctionMappedJournal, providing a combination of stateful journal behavior and functional operations.
Type parameters
- K
-
the type of the keys in the journal
- V
-
the type of the values in the journal
Value parameters
- f
-
a function that, given a key, computes its corresponding value
- xs
-
a map containing the initial key-value pairs in the journal
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait K => Vtrait AutoCloseableclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Appends a new entry to the journal by applying the stored function f to the given key h. The resulting key-value pair is then appended to the internal map, producing a new instance of FunctionMapJournal that reflects the updated state.
Appends a new entry to the journal by applying the stored function f to the given key h. The resulting key-value pair is then appended to the internal map, producing a new instance of FunctionMapJournal that reflects the updated state.
Value parameters
- k
-
the key for which the function
fwill be applied to generate its corresponding value
Attributes
- Returns
-
a new
FunctionMapJournal[K, V]instance containing the updated mapping
Applies the function f to the given key and returns the resulting value. This method uses the stored function f to compute the value associated with the provided key. TESTME is this method ever actually invoked? It seems like we always invoke apply((K,V)) CONSIDER if this method isn't invoked, then we don't need the f parameter in the declaration.
Applies the function f to the given key and returns the resulting value. This method uses the stored function f to compute the value associated with the provided key. TESTME is this method ever actually invoked? It seems like we always invoke apply((K,V)) CONSIDER if this method isn't invoked, then we don't need the f parameter in the declaration.
Value parameters
- key
-
the key for which the value is to be computed using the stored function
f
Attributes
- Returns
-
the value corresponding to the provided key, computed by the function
f - Definition Classes
-
Function1 -> AbstractMapJournal
Creates a new instance of AbstractMapJournal with the given map.
Creates a new instance of AbstractMapJournal with the given map.
Value parameters
- xs
-
the map to be used for initializing the new
AbstractMapJournalinstance
Attributes
- Returns
-
a new instance of
AbstractMapJournalcontaining the elements of the provided map
Inherited methods
Composes two instances of Function1 in a new Function1, with this function applied first.
Composes two instances of Function1 in a new Function1, with this function applied first.
Type parameters
- A
-
the result type of function
g
Value parameters
- g
-
a function R => A
Attributes
- Returns
-
a new function
fsuch thatf(x) == g(apply(x)) - Inherited from:
- Function1
Appends the specified element to this Appendable object, returning a new instance of the Appendable with the element included.
Appends the specified element to this Appendable object, returning a new instance of the Appendable with the element included.
Value parameters
- x
-
the element to be appended
Attributes
- Returns
-
a new
Appendable[X]instance containing the existing elements and the newly appended element - Inherited from:
- AbstractMapJournal
Composes two instances of Function1 in a new Function1, with this function applied last.
Composes two instances of Function1 in a new Function1, with this function applied last.
Type parameters
- A
-
the type to which function
gcan be applied
Value parameters
- g
-
a function A => T1
Attributes
- Returns
-
a new function
fsuch thatf(x) == apply(g(x)) - Inherited from:
- Function1
Retrieves the entries of the underlying map as an iterable collection of key-value pairs.
Retrieves the entries of the underlying map as an iterable collection of key-value pairs.
Attributes
- Returns
-
an
Iterablecontaining all key-value pairs present in the map - Inherited from:
- AbstractMapJournal
Retrieves the value associated with the specified key from the underlying map.
Retrieves the value associated with the specified key from the underlying map.
Value parameters
- key
-
the key to look up in the map
Attributes
- Returns
-
an
Optioncontaining the value associated with the key, orNoneif the key does not exist - Inherited from:
- AbstractMapJournal
Retrieves the keys of the underlying map as an iterable collection.
Retrieves the keys of the underlying map as an iterable collection.
Attributes
- Returns
-
an
Iterablecontaining all the keys present in the map - Inherited from:
- AbstractMapJournal
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Function1 -> Any
- Inherited from:
- Function1
Retrieves the values of the underlying map as an iterable collection.
Retrieves the values of the underlying map as an iterable collection.
Attributes
- Returns
-
an
Iterablecontaining all the values present in the map - Inherited from:
- AbstractMapJournal