com.phasmidsoftware.visitor.misc.AbstractMapJournal
An abstract class representing a map-based implementation of a Journal. This class provides mechanisms to manage key-value pairs immutably in a journal-like structure. It extends the Journal trait, implementing appendable and iterable behaviors.
The AbstractMapJournal relies on an underlying immutable Map to store key-value pairs, allowing retrieval, iteration, and the addition of elements in a functional style.
Type parameters
K
the type of keys maintained by this journal
V
the type of values associated with keys in this journal
Value parameters
map
the underlying immutable map containing the journal entries
Attributes
Constructor
Initializes the journal with an immutable map of key-value pairs
Graph
Reset zoom Hide graph Show graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Show all
Known subtypes
Members list
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 AbstractMapJournal instance
Attributes
Returns
a new instance of AbstractMapJournal containing the elements of the provided map
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
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
the value associated with the specified key
Throws
NoSuchElementException
if the key does not exist in the map
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 Iterable containing all key-value pairs present in the map
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 Option containing the value associated with the key, or None if the key does not exist
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 Iterable containing all the keys present in the map
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 Iterable containing all the values present in the map