Class StandardSvetovidReader

All Implemented Interfaces:
Closeable, AutoCloseable, SvetovidReader

public class StandardSvetovidReader extends DefaultSvetovidReader
This class provides an implementation of the SvetovidReader interface that reads all input from the "standard" input (see System.in).

Besides the implementation of the methods in the SvetovidReader interface, this class provides additional overloaded methods that write the given prompt string to the "standard" output before reading the requested data form the "standard" input.

Author:
Ivan Pribela
See Also:
  • Field Details

    • readFromNewLine

      protected boolean readFromNewLine
  • Constructor Details

    • StandardSvetovidReader

      public StandardSvetovidReader()
      Creates a new reader that reads all the input from the "standard" input.
  • Method Details

    • getReadFromNewLine

      public boolean getReadFromNewLine()
      Returns the indicator whether this reader will read input data from a new line or immediately after the displayed prompt message.
      Returns:
      true if this reader reads data from a new line after the displayed prompt message; false if the data is read immediately after the prompt.
    • setReadFromNewLine

      public void setReadFromNewLine(boolean readFromNewLine)
      Configures whether this reader should read input data from a new line or immediately after the displayed prompt.
      Parameters:
      readFromNewLine - true if this reader should read input data from a new line or false if it should do it immediately after the displayed prompt.
    • prompt

      protected void prompt(String prompt) throws SvetovidIOException
      Throws:
      SvetovidIOException
    • readBool

      public boolean readBool(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a boolean value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the boolean value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable boolean.
      SvetovidIOException - if an error occurred during the operation.
    • readByte

      public byte readByte(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a byte value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the byte value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable byte.
      SvetovidIOException - if an error occurred during the operation.
    • readShort

      public short readShort(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a short integer value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the short value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable short.
      SvetovidIOException - if an error occurred during the operation.
    • readInt

      public int readInt(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to an integer value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the int value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable int.
      SvetovidIOException - if an error occurred during the operation.
    • readLong

      public long readLong(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a long integer value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the long value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable long.
      SvetovidIOException - if an error occurred during the operation.
    • readFloat

      public float readFloat(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a floating-point value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the float value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable float.
      SvetovidIOException - if an error occurred during the operation.
    • readDouble

      public double readDouble(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a double-precision floating-point value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the double value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable double.
      SvetovidIOException - if an error occurred during the operation.
    • readChar

      public char readChar(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a character value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the char value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable char.
      SvetovidIOException - if an error occurred during the operation.
    • readToken

      public String readToken(String prompt) throws SvetovidIOException
      Reads one token and returns it as a string value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the String value read.
      Throws:
      SvetovidFormatException - if the token is null.
      SvetovidIOException - if an error occurred during the operation.
    • readBoolBoxed

      public Boolean readBoolBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a boolean value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Boolean value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable boolean.
      SvetovidIOException - if an error occurred during the operation.
    • readByteBoxed

      public Byte readByteBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a byte value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Byte value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable byte.
      SvetovidIOException - if an error occurred during the operation.
    • readShortBoxed

      public Short readShortBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a short integer value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Short value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable short.
      SvetovidIOException - if an error occurred during the operation.
    • readIntBoxed

      public Integer readIntBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to an integer value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Integer value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable int.
      SvetovidIOException - if an error occurred during the operation.
    • readLongBoxed

      public Long readLongBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a long integer value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Long value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable long.
      SvetovidIOException - if an error occurred during the operation.
    • readFloatBoxed

      public Float readFloatBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a floating-point value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Float value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable float.
      SvetovidIOException - if an error occurred during the operation.
    • readDoubleBoxed

      public Double readDoubleBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a double-precision floating-point value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Double value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable double.
      SvetovidIOException - if an error occurred during the operation.
    • readCharBoxed

      public Character readCharBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one token and converts it to a character value. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      the Character value read.
      Throws:
      SvetovidFormatException - if the token is not a parsable character.
      SvetovidIOException - if an error occurred during the operation.
    • readBoolArray

      public boolean[] readBoolArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to boolean values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of boolean values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable boolean.
      SvetovidIOException - if an error occurred during the operation.
    • readByteArray

      public byte[] readByteArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to byte values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of byte values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable byte.
      SvetovidIOException - if an error occurred during the operation.
    • readShortArray

      public short[] readShortArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to short integer values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of short values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable short.
      SvetovidIOException - if an error occurred during the operation.
    • readIntArray

      public int[] readIntArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to integer values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of int values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable integer.
      SvetovidIOException - if an error occurred during the operation.
    • readLongArray

      public long[] readLongArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to long integer values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of long values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable long.
      SvetovidIOException - if an error occurred during the operation.
    • readFloatArray

      public float[] readFloatArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to floating-point values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of float values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable float.
      SvetovidIOException - if an error occurred during the operation.
    • readDoubleArray

      public double[] readDoubleArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to double-precision floating-point values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of double values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable double.
      SvetovidIOException - if an error occurred during the operation.
    • readCharArray

      public char[] readCharArray(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to character values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of char values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable character.
      SvetovidIOException - if an error occurred during the operation.
    • readTokenArray

      public String[] readTokenArray(String prompt) throws SvetovidIOException
      Reads one line, separates it into tokens and returns them as string values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of String values read.
      Throws:
      SvetovidIOException - if an error occurred during the operation.
    • readBoolArrayBoxed

      public Boolean[] readBoolArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to boolean values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Boolean values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable boolean.
      SvetovidIOException - if an error occurred during the operation.
    • readByteArrayBoxed

      public Byte[] readByteArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to byte values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Byte values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable byte.
      SvetovidIOException - if an error occurred during the operation.
    • readShortArrayBoxed

      public Short[] readShortArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to short integer values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Short values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable short.
      SvetovidIOException - if an error occurred during the operation.
    • readIntArrayBoxed

      public Integer[] readIntArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to integer values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Integer values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable integer.
      SvetovidIOException - if an error occurred during the operation.
    • readLongArrayBoxed

      public Long[] readLongArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to long integer values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Long values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable long.
      SvetovidIOException - if an error occurred during the operation.
    • readFloatArrayBoxed

      public Float[] readFloatArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to floating-point values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Float values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable float.
      SvetovidIOException - if an error occurred during the operation.
    • readDoubleArrayBoxed

      public Double[] readDoubleArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to double-precision floating-point values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Double values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable double.
      SvetovidIOException - if an error occurred during the operation.
    • readCharArrayBoxed

      public Character[] readCharArrayBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads one line, separates it into tokens and converts them to character values. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      an array of Character values read.
      Throws:
      SvetovidFormatException - if one of the tokens is not a parsable character.
      SvetovidIOException - if an error occurred during the operation.
    • readLine

      public String readLine(String prompt) throws SvetovidIOException
      Reads a line of text and returns it as a string. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      A String containing the contents of the line, not including any line-termination characters, or null if the end of the source has been reached.
      Throws:
      SvetovidIOException - if an error occurred during the operation.
    • readLine

      public String readLine(String prompt, String defaultValue) throws SvetovidIOException
      Reads a line of text and returns it as a string. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out. If an empty string is read, the defaultValue is returned.
      Parameters:
      prompt - the message to prompt to the user
      defaultValue - the value to return if nothing is entered
      Returns:
      A String containing the contents of the line, not including any line-termination characters, null if the end of the source has been reached, or defaultValue if the line was empty.
      Throws:
      SvetovidIOException - if an error occurred during the operation.
    • readAllLines

      public String[] readAllLines(String prompt) throws SvetovidIOException
      Read all remaining lines and returns them as an array of strings. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      A String array containing the contents of the remaining lines, not including any line-termination characters, or an empty array if the end of the source has been reached.
      Throws:
      SvetovidIOException - if an error occurred during the operation.
    • readAll

      public String readAll(String prompt) throws SvetovidIOException
      Reads all remaining content and returns it as a string. Before reading any content the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      A String containing all the remaining contents of the source, or null if the end of the source has been reached.
      Throws:
      SvetovidIOException - if an error occurred during the operation.
    • readBoolMatrix

      public boolean[][] readBoolMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a boolean matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of boolean values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable boolean.
      SvetovidIOException - if an error occurred during the operation.
    • readByteMatrix

      public byte[][] readByteMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a byte matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of byte values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable byte.
      SvetovidIOException - if an error occurred during the operation.
    • readShortMatrix

      public short[][] readShortMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a shot integer matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of short values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable short.
      SvetovidIOException - if an error occurred during the operation.
    • readIntMatrix

      public int[][] readIntMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to an integer matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of int values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable integer.
      SvetovidIOException - if an error occurred during the operation.
    • readLongMatrix

      public long[][] readLongMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a long integer matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of long values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable long.
      SvetovidIOException - if an error occurred during the operation.
    • readFloatMatrix

      public float[][] readFloatMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a floating-point matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of float values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable float.
      SvetovidIOException - if an error occurred during the operation.
    • readDoubleMatrix

      public double[][] readDoubleMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a double-precision floating-point matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of double values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable double.
      SvetovidIOException - if an error occurred during the operation.
    • readCharMatrix

      public char[][] readCharMatrix(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a character matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of char values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable character.
      SvetovidIOException - if an error occurred during the operation.
    • readTokenMatrix

      public String[][] readTokenMatrix(String prompt) throws SvetovidIOException
      Reads multiple lines and converts the data to a string matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of String values read.
      Throws:
      SvetovidIOException - if an error occurred during the operation.
    • readBoolMatrixBoxed

      public Boolean[][] readBoolMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a boolean matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Boolean values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable boolean.
      SvetovidIOException - if an error occurred during the operation.
    • readByteMatrixBoxed

      public Byte[][] readByteMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a byte matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Byte values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable byte.
      SvetovidIOException - if an error occurred during the operation.
    • readShortMatrixBoxed

      public Short[][] readShortMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a shot integer matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Short values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable short.
      SvetovidIOException - if an error occurred during the operation.
    • readIntMatrixBoxed

      public Integer[][] readIntMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to an integer matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Integer values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable integer.
      SvetovidIOException - if an error occurred during the operation.
    • readLongMatrixBoxed

      public Long[][] readLongMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a long integer matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Long values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable long.
      SvetovidIOException - if an error occurred during the operation.
    • readFloatMatrixBoxed

      public Float[][] readFloatMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a floating-point matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Float values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable float.
      SvetovidIOException - if an error occurred during the operation.
    • readDoubleMatrixBoxed

      public Double[][] readDoubleMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a double-precision floating-point matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out.
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Double values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable double.
      SvetovidIOException - if an error occurred during the operation.
    • readCharMatrixBoxed

      public Character[][] readCharMatrixBoxed(String prompt) throws SvetovidFormatException, SvetovidIOException
      Reads multiple lines and converts the data to a character matrix. The matrix is read row by row until an empty row is found or the end of input is reached. Before reading any data the specified prompt message is displayed to the user on the "standard" output using Svetovid.out .
      Parameters:
      prompt - the message to prompt to the user
      Returns:
      a matrix of Character values read.
      Throws:
      SvetovidFormatException - if one of the read values is not a parsable character.
      SvetovidIOException - if an error occurred during the operation.