WriterOutput

com.phasmidsoftware.gambit.attic.WriterOutput
case class WriterOutput(writer: Writer, initialIndentation: CharSequence = ..., stringBuilder: StringBuilder = ..., transform: CharSequence => CharSequence = ...) extends BufferedCharSequenceOutput[Writer]

Case class implementing Output and based on a Writer. This type of Output is backed by the given writer. This class extends the abstract class BufferedCharSequenceOutput[Writer]. The following traits are implemented: Output, CharacterOutput, BufferedOutput, BackedOutput[Writer].

Value parameters

initialIndentation

the initial value of indentation.

stringBuilder

the StringBuilder used for buffering characters.

writer

the appendable to which characters are flushed when appropriate.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait BackedOutput[Writer]
trait TypedOutput
trait Output
trait AutoCloseable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

type OutputType = CharSequence

The output type for this TypedOutput

The output type for this TypedOutput

Attributes

Inherited from:
CharacterOutput

Value members

Concrete methods

def copy: Output

Method to create a copy of this Output but unbacked. 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 but unbacked. 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 an UnbackedOutput, 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.

def isBacked: Boolean

Method to return whether or not this Output is backed by real output type.

Method to return whether or not this Output is backed by real output type.

Attributes

Returns

true if this Output is backed.

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
Any

Inherited methods

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.

Inherited from:
TypedOutput
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.

Inherited from:
Output
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.

Inherited from:
BufferedOutput
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 from:
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.

Inherited from:
TypedOutput

Method to append an x of type OutputType to this Output.

Method to append an x of type OutputType to this Output.

Value parameters

x

the input.

Attributes

Returns

this Output.

Inherited from:
BufferedOutput
def appendToBuffer(x: CharSequence): Unit

Method to append input to the buffer.

Method to append input to the buffer.

Value parameters

x

the input to be appended.

Attributes

Inherited from:
BufferedCharSequenceOutput
def asLine(x: Any): Output

Attributes

Inherited from:
CharacterOutput
def asOutputType(x: Any): CharSequence

A converter from type Any to OutputType.

A converter from type Any to OutputType.

Value parameters

x

the input.

Attributes

Returns

the input, expressed an an OutputType.

Inherited from:
CharacterOutput
def clear: CharSequence

Method to clear the contents of the buffer and return its value.

Method to clear the contents of the buffer and return its value.

Attributes

Returns

the OutputType that was the contents of the buffer.

Inherited from:
BufferedCharSequenceOutput
def close(): Unit

Attributes

Inherited from:
BufferedCharSequenceOutput
def concatenate(output: Output): Output

Attributes

Inherited from:
BufferedCharSequenceOutput
def content: CharSequence

Method to return the current content of the buffer.

Method to return the current content of the buffer.

Attributes

Returns

an OutputType

Inherited from:
BufferedCharSequenceOutput
def contentBrief: String

Attributes

Inherited from:
BufferedCharSequenceOutput
def flush: Output

Flush the buffer (sb) to the output.

Flush the buffer (sb) to the output.

Attributes

Returns

an Output with an empty buffer.

Inherited from:
BufferedCharSequenceOutput

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

Inherited from:
BufferedCharSequenceOutput
def isEmpty: Boolean

This method is essentially non-functional in the JVM. It seemed like a good idea at the time!

This method is essentially non-functional in the JVM. It seemed like a good idea at the time!

Attributes

Inherited from:
BufferedCharSequenceOutput
def isFlushed: Boolean

Method to determine if any data has been flushed to the backing sink.

Method to determine if any data has been flushed to the backing sink.

Attributes

Inherited from:
BufferedCharSequenceOutput

Method to do a conditional flush of the buffer.

Method to do a conditional flush of the buffer.

Attributes

Returns

this Output.

Inherited from:
BufferedOutput
def needsToFlush: Boolean

Method to determine if the buffer needs to be flushed, for example it's getting too big.

Method to determine if the buffer needs to be flushed, for example it's getting too big.

Attributes

Returns

true if it would be a good idea to flush the buffer.

Inherited from:
BufferedCharSequenceOutput
def nonEmpty: Boolean

Method to determine if the buffer is non-empty.

Method to determine if the buffer is non-empty.

Attributes

Returns

true if the buffer is non-empty.

Inherited from:
BufferedOutput
def persist(x: CharSequence): Unit

This method copies the given content x to the backing object.

This method copies the given content x to the backing object.

Value parameters

x

the content to be persisted.

Attributes

Inherited from:
BufferedCharSequenceOutput
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Method to return an Output built from the OutputType x.

Method to return an Output built from the OutputType x.

Value parameters

x

the input of type OutputType.

Attributes

Returns

a new instance of Output.

Inherited from:
BufferedOutput

A "zero" element for this TypedOutput. If OutputType is CharSequence, then we will return an empty String.

A "zero" element for this TypedOutput. If OutputType is CharSequence, then we will return an empty String.

Attributes

Returns

a suitable empty OutputType.

Inherited from:
CharacterOutput

Inherited fields

val appendable: Writer

Attributes

Inherited from:
BufferedCharSequenceOutput
var flushed: Boolean

Attributes

Inherited from:
BufferedCharSequenceOutput
var indentation: CharSequence

Attributes

Inherited from:
BufferedCharSequenceOutput
val sb: StringBuilder

Attributes

Inherited from:
BufferedCharSequenceOutput