FunctionMappedJournal

com.phasmidsoftware.visitor.misc.FunctionMappedJournal
trait FunctionMappedJournal[X, Y] extends Journal[(X, Y)], X => Y

A trait that combines the behavior of a function and a journal.

FunctionMappedJournal extends both a function (X => Y) and Journal[(X, Y)]. This allows it to act as a function that maps input of type X to output of type Y, while also maintaining a journal of past inputs and outputs in the form of (X, Y) pairs.

The journal functionality provides the capability to keep track of operations performed by the function, making it suitable for scenarios like auditing, logging, or building histories of function calls and results.

Type parameters

X

the type of input to the function

Y

the type of output from the function

Attributes

Graph
Supertypes
trait X => Y
trait Journal[(X, Y)]
trait Appendable[(X, Y)]
trait AutoCloseable
class Object
trait Matchable
class Any
Show all
Known subtypes
class FunctionMapJournal[K, V]

Members list

Value members

Inherited methods

def andThen[A](g: Y => A): X => A

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 f such that f(x) == g(apply(x))

Inherited from:
Function1
def compose[A](g: A => X): A => Y

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 g can be applied

Value parameters

g

a function A => T1

Attributes

Returns

a new function f such that f(x) == apply(g(x))

Inherited from:
Function1
override def toString(): String

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

Inherited and Abstract methods

def append(x: (X, Y)): Appendable[(X, Y)]

Appends the specified element to this appendable structure and returns the instance itself, allowing for a fluent interface.

Appends the specified element to this appendable structure and returns the instance itself, allowing for a fluent interface.

Value parameters

x

the element of type X to be appended

Attributes

Returns

the instance of the appendable structure with the new element appended

Inherited from:
Appendable
def apply(v1: X): Y

Applies the body of this function to the argument.

Applies the body of this function to the argument.

Value parameters

v1

the function argument

Attributes

Returns

the result of function application.

Inherited from:
Function1
def close(): Unit

Attributes

Inherited from:
Journal