com.phasmidsoftware.visitor.misc.MapJournal
See theMapJournal companion object
A MapJournal is a concrete implementation of the Journal trait that maintains a collection of elements represented as key-value pairs using a Map.
This class provides functionality to append new elements, retrieve elements by key, and iterate over the contents of the journal. It ensures immutability by returning a new instance when modifications, such as appending, are performed.
Type parameters
K
the type of keys maintained by the map
V
the type of values associated with the keys
Value parameters
map
the underlying map storing the key-value pairs of the journal
Attributes
Companion
object
Graph
Reset zoom Hide graph Show graph
Supertypes
trait Serializable
trait Product
trait Equals
trait AutoCloseable
class Object
trait Matchable
class Any
Show all
Members list
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
Definition Classes
Creates a new MapJournal instance containing the specified key-value pairs.
Creates a new MapJournal instance containing the specified key-value pairs.
This method is a utility for constructing a MapJournal from an existing Map.
Value parameters
xs
the key-value pairs to be included in the new MapJournal
Attributes
Returns
a new instance of MapJournal containing the provided key-value pairs
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
Inherited from:
AbstractMapJournal
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
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 Option containing the value associated with the key, or None if 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 Iterable containing 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
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
Inherited from:
AbstractMapJournal