PIRL.Viewers

## Class Stream_Monitor.Monitor_Writer

- java.lang.Object
- - java.io.Writer
  - - PIRL.Viewers.Stream_Monitor.Monitor_Writer

All Implemented Interfaces:
  Closeable, Flushable, Appendable, AutoCloseable, Styled_Writer

Enclosing class:
  Stream_Monitor

    public class Stream_Monitor.Monitor_Writer
    extends Writer
    implements Styled_Writer

### Field Summary

### Fields inherited from class java.io.Writer

`lock`

### Constructor Summary

Constructors
Constructor and Description
`Stream_Monitor.Monitor_Writer()`

### Method Summary

Methods
`void` `close()` The currently buffered characters are flushed, but the writer can still be written to.
`void` `flush()` Flush the currently buffered characters to the monitor display.
`void` `write(char[] characters, int offset, int amount)` Write an array of characters.
`void` `write(int character)` Write a character.
`Stream_Monitor.Monitor_Writer` `Write(String text)` Write text to the monitor.
`Stream_Monitor.Monitor_Writer` `Write(String text, AttributeSet style)` Write styled text to the monitor.

### Methods inherited from class java.io.Writer

`append, append, append, write, write, write`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Stream_Monitor.Monitor_Writer

    public Stream_Monitor.Monitor_Writer()

### Method Detail

#### write

    public void write(int character)

Write a character.

Each character written is buffered until an end-of-line sequence is encountered at which point the buffer is `flushed` to the display. An end-of-line line sequence is any one of a line feed ('\n', 0x0A), a carriage return ('\r', 0x0D), or a carriage return followed immediately by a linefeed.

Overrides:
  `write` in class `Writer`
Parameters:
  `character` - An integer value of which only the least significant 16-bits are used.

#### write

    public void write(char[] characters,
             int offset,
             int amount)

Write an array of characters.

The characters are buffered until an end-of-line sequence is encountered or the buffer is full at which point the buffer is `flushed` to the display. An end-of-line line sequence is any one of a line feed ('\n', 0x0A), a carriage return ('\r', 0x0D), or a carriage return followed immediately by a linefeed.

Specified by:
  `write` in class `Writer`
Parameters:
  `characters` - The char array containing the characters to be written. If null or empty nothing is done.
  `offset` - Array offset from which to start writing characters.
  `amount` - The number of characters to write. If zero nothing is done.
Throws:
  `IndexOutOfBoundsException` - If the offset or amount are negative or the offset plus the amount is greater than the length of the array.

#### Write

    public Stream_Monitor.Monitor_Writer Write(String text,
                                      AttributeSet style)

Write styled text to the monitor.

Any currently buffered characters are flushed before the text is written to the monitor.

Specified by:
  `Write` in interface `Styled_Writer`
Parameters:
  `text` - The text String to be appended to the monitor.
  `style` - The AttributeSet to be applied to the text. This may be null if plain text is to be displayed.
Returns:
  This Styled_Writer
See Also:
  `Stream_Monitor.Write(String, AttributeSet)`

#### Write

    public Stream_Monitor.Monitor_Writer Write(String text)

Write text to the monitor.

Any currently buffered characters are flushed before the text is written to the monitor.

Specified by:
  `Write` in interface `Styled_Writer`
Parameters:
  `text` - The text String to be appended to the monitor.
Returns:
  This Styled_Writer
See Also:
  `Stream_Monitor.Write(String)`

#### flush

    public void flush()

Flush the currently buffered characters to the monitor display.

The currently buffered characters are converted to a String that is `written` to the monitor display. The text is eligible for `auto-style` processing, if enabled.

Specified by:
  `flush` in interface `Flushable`
Specified by:
  `flush` in class `Writer`

#### close

    public void close()

The currently buffered characters are flushed, but the writer can still be written to.

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in class `Writer`