Interface SimpleWriter

All Superinterfaces:
AutoCloseable, SimpleWriterKernel, Standard<SimpleWriter>
All Known Implementing Classes:
SimpleWriter1L, SimpleWriterSecondary

public interface SimpleWriter extends SimpleWriterKernel
SimpleWriterKernel enhanced with secondary methods.
Mathematical Definitions:
LINE_SEPARATOR: string of character is
  [character(s) used to denote line separator on the local system]
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    print(boolean b)
    Appends TO_STRING(b) to the end of this.content.
    void
    print(char c)
    Appends <c> to the end of this.content.
    void
    print(double d)
    Appends TO_STRING(d) to the end of this.content.
    void
    print(double d, int precision, boolean scientific)
    Appends TO_STRING(d, precision, scientific) to the end of this.content.
    void
    print(int i)
    Appends TO_STRING(i) to the end of this.content.
    void
    print(long x)
    Appends TO_STRING(x) to the end of this.content.
    void
    Appends the string representation of o to the end of this.content.
    void
    Appends s to the end of this.content.
    void
    Appends a line separator to the end of this.content.
    void
    println(boolean b)
    Appends TO_STRING(b) and a line separator to the end of this.content.
    void
    println(char c)
    Appends <c> and a line separator to the end of this.content.
    void
    println(double d)
    Appends TO_STRING(d) and a line separator to the end of this.content.
    void
    println(double d, int precision, boolean scientific)
    Appends TO_STRING(d, precision, scientific) and a line separator to the end of this.content.
    void
    println(int i)
    Appends TO_STRING(i) and a line separator to the end of this.content.
    void
    println(long x)
    Appends TO_STRING(x) and a line separator to the end of this.content.
    void
    Appends the string representation of o and a line separator to the end of this.content.
    void
    Appends s and a line separator to the end of this.content .

    Methods inherited from interface components.simplewriter.SimpleWriterKernel

    close, isOpen, name, write

    Methods inherited from interface components.standard.Standard

    clear, newInstance, transferFrom
  • Method Details

    • print

      void print(String s)
      Appends s to the end of this.content.
      Parameters:
      s - the string to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * s
    • print

      void print(int i)
      Appends TO_STRING(i) to the end of this.content.
      Parameters:
      i - the integer to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(i)
    • print

      void print(long x)
      Appends TO_STRING(x) to the end of this.content.
      Parameters:
      x - the long to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(x)
    • print

      void print(double d)
      Appends TO_STRING(d) to the end of this.content.
      Parameters:
      d - the double to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(d)
    • print

      void print(double d, int precision, boolean scientific)
      Appends TO_STRING(d, precision, scientific) to the end of this.content.
      Parameters:
      d - the double to output
      precision - the number of decimal digits printed
      scientific - whether to use scientific notation or not
      Updates:
      this.content
      Requires:
      this.is_open and precision >= 0
      Ensures:
      this.content = #this.content * TO_STRING(d, precision, scientific)
    • print

      void print(boolean b)
      Appends TO_STRING(b) to the end of this.content.
      Parameters:
      b - the boolean to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(b)
    • print

      void print(char c)
      Appends <c> to the end of this.content.
      Parameters:
      c - the character to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * <c>
    • print

      void print(Object o)
      Appends the string representation of o to the end of this.content.
      Parameters:
      o - the Object to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * to_string(o)
    • println

      void println(String s)
      Appends s and a line separator to the end of this.content .
      Parameters:
      s - the string to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * s * LINE_SEPARATOR
    • println

      void println(int i)
      Appends TO_STRING(i) and a line separator to the end of this.content.
      Parameters:
      i - the integer to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(i) * LINE_SEPARATOR
    • println

      void println(long x)
      Appends TO_STRING(x) and a line separator to the end of this.content.
      Parameters:
      x - the long to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(x) * LINE_SEPARATOR
    • println

      void println(double d)
      Appends TO_STRING(d) and a line separator to the end of this.content.
      Parameters:
      d - the double to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(d) * LINE_SEPARATOR
    • println

      void println(double d, int precision, boolean scientific)
      Appends TO_STRING(d, precision, scientific) and a line separator to the end of this.content.
      Parameters:
      d - the double to output
      precision - the number of decimal digits printed
      scientific - whether to use scientific notation or not
      Updates:
      this.content
      Requires:
      this.is_open and precision >= 0
      Ensures:
      this.content =
        #this.content * TO_STRING(d, precision, scientific) * LINE_SEPARATOR
    • println

      void println(boolean b)
      Appends TO_STRING(b) and a line separator to the end of this.content.
      Parameters:
      b - the boolean to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * TO_STRING(b) * LINE_SEPARATOR
    • println

      void println(char c)
      Appends <c> and a line separator to the end of this.content.
      Parameters:
      c - the character to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * <c> * LINE_SEPARATOR
    • println

      void println()
      Appends a line separator to the end of this.content.
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * LINE_SEPARATOR
    • println

      void println(Object o)
      Appends the string representation of o and a line separator to the end of this.content.
      Parameters:
      o - the Object to output
      Updates:
      this.content
      Requires:
      this.is_open
      Ensures:
      this.content = #this.content * to_string(o) * LINE_SEPARATOR