JournaledVisitor

com.phasmidsoftware.visitor.core.JournaledVisitor
See theJournaledVisitor companion class

Attributes

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

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def withListJournal[V, R]: JournaledVisitor[V, R, ListJournal[(V, Option[R])]]

Creates a journaled visitor using a list-based journal for tracking visited nodes.

Creates a journaled visitor using a list-based journal for tracking visited nodes.

The resulting visitor employs a ListJournal to record visited vertices in a last-in-first-out (LIFO) order. This is suitable for scenarios requiring LIFO journaling of visited nodes, such as depth-first traversal.

Type parameters

R

the result type associated with each vertex

V

the type of vertices being visited

Attributes

Returns

a JournaledVisitor configured with a ListJournal

def withListJournalAndCameFrom[V, R]: JournaledVisitor[V, R, ListJournal[(V, Option[R])]]

Creates a journaled visitor with a list-based journal and an empty came-from journal.

Creates a journaled visitor with a list-based journal and an empty came-from journal.

The resulting visitor uses a ListJournal to track visited nodes, maintaining a LIFO order. Additionally, it enables tracking of came-from relationships to record predecessor information for visited nodes.

Type parameters

R

the result type associated with each vertex

V

the type of vertices being visited

Attributes

Returns

a JournaledVisitor configured with a ListJournal and a came-from journal

def withQueueJournal[V, R]: JournaledVisitor[V, R, QueueJournal[(V, Option[R])]]

Creates a journaled visitor using a queue-based journal for tracking visited nodes.

Creates a journaled visitor using a queue-based journal for tracking visited nodes.

The resulting visitor employs a QueueJournal to record visited vertices in a first-in-first-out (FIFO) order. This is particularly suitable for breadth-first traversal scenarios or any situation requiring FIFO journaling of visited nodes.

Type parameters

R

the result type associated with each vertex

V

the type of vertices being visited

Attributes

Returns

a JournaledVisitor configured with a QueueJournal

def withQueueJournalAndCameFrom[V, R]: JournaledVisitor[V, R, QueueJournal[(V, Option[R])]]

Creates a journaled visitor with a queue-based journal and an empty came-from journal.

Creates a journaled visitor with a queue-based journal and an empty came-from journal.

The resulting visitor uses a QueueJournal to track visited nodes in a FIFO order. Additionally, it enables tracking of came-from relationships to record predecessor information for visited nodes.

Type parameters

R

the result type associated with each vertex

V

the type of vertices being visited

Attributes

Returns

a JournaledVisitor configured with a QueueJournal and a came-from journal