Class StandardSvetovidReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.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:
    System.in, SvetovidReader
    • Field Detail

      • readFromNewLine

        protected boolean readFromNewLine
    • Constructor Detail

      • StandardSvetovidReader

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

      • 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.
      • readBool

        public boolean readBool​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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 java.lang.String readToken​(java.lang.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 java.lang.Boolean readBoolBoxed​(java.lang.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 java.lang.Byte readByteBoxed​(java.lang.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 java.lang.Short readShortBoxed​(java.lang.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 java.lang.Integer readIntBoxed​(java.lang.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 java.lang.Long readLongBoxed​(java.lang.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 java.lang.Float readFloatBoxed​(java.lang.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 java.lang.Double readDoubleBoxed​(java.lang.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 java.lang.Character readCharBoxed​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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 java.lang.String[] readTokenArray​(java.lang.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 java.lang.Boolean[] readBoolArrayBoxed​(java.lang.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 java.lang.Byte[] readByteArrayBoxed​(java.lang.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 java.lang.Short[] readShortArrayBoxed​(java.lang.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 java.lang.Integer[] readIntArrayBoxed​(java.lang.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 java.lang.Long[] readLongArrayBoxed​(java.lang.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 java.lang.Float[] readFloatArrayBoxed​(java.lang.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 java.lang.Double[] readDoubleArrayBoxed​(java.lang.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 java.lang.Character[] readCharArrayBoxed​(java.lang.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 java.lang.String readLine​(java.lang.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 java.lang.String readLine​(java.lang.String prompt,
                                         java.lang.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 java.lang.String[] readAllLines​(java.lang.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 java.lang.String readAll​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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 java.lang.String[][] readTokenMatrix​(java.lang.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 java.lang.Boolean[][] readBoolMatrixBoxed​(java.lang.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 java.lang.Byte[][] readByteMatrixBoxed​(java.lang.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 java.lang.Short[][] readShortMatrixBoxed​(java.lang.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 java.lang.Integer[][] readIntMatrixBoxed​(java.lang.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 java.lang.Long[][] readLongMatrixBoxed​(java.lang.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 java.lang.Float[][] readFloatMatrixBoxed​(java.lang.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 java.lang.Double[][] readDoubleMatrixBoxed​(java.lang.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 java.lang.Character[][] readCharMatrixBoxed​(java.lang.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.