Tracer

com.phasmidsoftware.visitor.core.Tracer
See theTracer companion trait
object Tracer

Attributes

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

Members list

Value members

Concrete methods

def collectionMsg[A](c: Iterable[A]): (String, String)

Convenience helper for the common case where brief is a collection size and detail is the collection elements.

Convenience helper for the common case where brief is a collection size and detail is the collection elements.

 val (b, d) = Tracer.collectionMsg(vertices)
 tracer.trace(1, b, d)

Attributes

def summary[V](out: PrintStream = ...): Tracer[V]

A summary tracer that emits only top-level (depth 0) messages, using brief only — detail is never evaluated.

A summary tracer that emits only top-level (depth 0) messages, using brief only — detail is never evaluated.

Useful for a first look: students see only the major phases of the algorithm without the per-vertex noise.

Value parameters

out

the stream to write to; defaults to System.out.

Attributes

def verbose[V](maxDepth: Int = ..., out: PrintStream = ...): Tracer[V]

A verbose tracer that indents output by two spaces per depth level and emits detail when non-empty, falling back to brief otherwise.

A verbose tracer that indents output by two spaces per depth level and emits detail when non-empty, falling back to brief otherwise.

Type parameters

V

the vertex type

Value parameters

maxDepth

only messages at or below this depth are emitted; defaults to Int.MaxValue (emit everything).

out

the stream to write to; defaults to System.out. Pass a custom PrintStream in tests to capture output without touching global state.

Attributes

Givens

Givens

given silent: [V] => silent[V]

The silent (no-op) tracer. Resolved automatically as the default given so that all algorithms compile and run without any explicit tracer in scope. Neither brief nor detail is evaluated.

The silent (no-op) tracer. Resolved automatically as the default given so that all algorithms compile and run without any explicit tracer in scope. Neither brief nor detail is evaluated.

Attributes