Output

com.phasmidsoftware.gambit.attic.Output
See theOutput companion object
sealed trait Output extends AutoCloseable

Trait to define the behavior of an AutoCloseable that is a pseudo-monadic IO type for output.

In general, when two Outputs are concatenated (using ++), we merge the content of the Output on the right into the Output on the left. That way, it makes sense that the Output on the left is backed by a write-store (such as a Writer). The concatenation logic tries its best to keep things in order and appropriately backed.

NOTE: indentation also tends to be applied to the Output on the left. However, if new (unbacked) Outputs are created to be used for outputting indented values, then such Outputs should be explicitly indented also. A warning could be created if two Outputs are merged with different indents (but is currently commented out).

Attributes

Companion
object
Graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def ++(other: Output): Output

Concatenate this Output (first) and x (second).

Concatenate this Output (first) and x (second).

Value parameters

other

the other Output object.

Attributes

Returns

this Output.

def ++(xs: Iterator[Output])(implicit separator: Output): Output

Concatenate each element of the iterator xs to this in turn.

Concatenate each element of the iterator xs to this in turn.

Value parameters

separator

an implicit separator

xs

the iterator of Outputs.

Attributes

Returns

this Output.

def :+(x: Any): Output

Append x to this Output.

Append x to this Output.

Value parameters

x

an object of type Any

Attributes

Returns

this Output.

def copy: Output

Method to create a copy of this Output. Content (whether flushed or not) will never be copied, but the other parameters of this Output may or may not be copied, depending on the actual implementation.

Method to create a copy of this Output. Content (whether flushed or not) will never be copied, but the other parameters of this Output may or may not be copied, depending on the actual implementation.

Attributes

Returns

a new Output which is, essentially, similar to this but without any content.

def indent(c: CharSequence): Output

Indent this Output so that the next insertBreak will use the updated indentation.

Indent this Output so that the next insertBreak will use the updated indentation.

Value parameters

c

the indentation to be added.

Attributes

Returns

a new Output with the appropriate indentation.

This method inserts a break into the output. If the output is based on character sequences, then this method will cause a newline character to be inserted.

This method inserts a break into the output. If the output is based on character sequences, then this method will cause a newline character to be inserted.

Attributes

Returns

this

Concrete methods

def ++(xs: Iterable[Output])(implicit separator: Output): Output

Concatenate each element of the iterable xs to this in turn.

Concatenate each element of the iterable xs to this in turn.

Value parameters

separator

an implicit separator

xs

an iterable of Outputs.

Attributes

Returns

this Output.

def +:(x: Any): Output

Append this to the Output formed by x. NOTE: that this assumes that Output.apply is defined for String.

Append this to the Output formed by x. NOTE: that this assumes that Output.apply is defined for String.

Value parameters

x

an Any

Attributes

Returns

an Output, not necessarily this.

Inherited and Abstract methods

def close(): Unit

Attributes

Inherited from:
AutoCloseable