FunctionMapJournal

com.phasmidsoftware.visitor.misc.FunctionMapJournal
See theFunctionMapJournal companion class

An implementation of a journal backed by a map and a key-value computing function.

The FunctionMapJournal stores a map of keys and their associated values, as well as a function f that computes the value for a given key. It provides methods to compute values, append to the journal by applying the function f to a key, and create new instances with updated maps.

This class is designed to be used in scenarios where values for keys need to be dynamically generated or updated using a predefined function.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def empty[K, V](f: K => V): FunctionMapJournal[K, V]

Creates an empty instance of FunctionMapJournal with an initial empty map and a function f that computes values based on keys.

Creates an empty instance of FunctionMapJournal with an initial empty map and a function f that computes values based on keys.

Value parameters

f

a function that, given a key of type K, computes a corresponding value of type V

Attributes

Returns

a new FunctionMapJournal[K, V] instance with an empty map and the provided function