Package org.svetovid.io
Class StandardSvetovidReader
java.lang.Object
org.svetovid.io.AbstractSvetovidReader
org.svetovid.io.DefaultSvetovidReader
org.svetovid.io.StandardSvetovidReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SvetovidReader
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.svetovid.io.AbstractSvetovidReader
AbstractSvetovidReader.TokenType
-
Field Summary
Fields inherited from class org.svetovid.io.DefaultSvetovidReader
reader
Fields inherited from class org.svetovid.io.AbstractSvetovidReader
lastException, line, throwingExceptions, tokenContent, tokenType, whitespace
-
Constructor Summary
ConstructorDescriptionCreates a new reader that reads all the input from the "standard" input. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the indicator whether this reader will read input data from a new line or immediately after the displayed prompt message.protected void
Reads all remaining content and returns it as a string.String[]
readAllLines
(String prompt) Read all remaining lines and returns them as an array of strings.boolean
Reads one token and converts it to a boolean value.boolean[]
readBoolArray
(String prompt) Reads one line, separates it into tokens and converts them to boolean values.Boolean[]
readBoolArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to boolean values.readBoolBoxed
(String prompt) Reads one token and converts it to a boolean value.boolean[][]
readBoolMatrix
(String prompt) Reads multiple lines and converts the data to a boolean matrix.Boolean[][]
readBoolMatrixBoxed
(String prompt) Reads multiple lines and converts the data to a boolean matrix.byte
Reads one token and converts it to a byte value.byte[]
readByteArray
(String prompt) Reads one line, separates it into tokens and converts them to byte values.Byte[]
readByteArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to byte values.readByteBoxed
(String prompt) Reads one token and converts it to a byte value.byte[][]
readByteMatrix
(String prompt) Reads multiple lines and converts the data to a byte matrix.Byte[][]
readByteMatrixBoxed
(String prompt) Reads multiple lines and converts the data to a byte matrix.char
Reads one token and converts it to a character value.char[]
readCharArray
(String prompt) Reads one line, separates it into tokens and converts them to character values.readCharArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to character values.readCharBoxed
(String prompt) Reads one token and converts it to a character value.char[][]
readCharMatrix
(String prompt) Reads multiple lines and converts the data to a character matrix.Character[][]
readCharMatrixBoxed
(String prompt) Reads multiple lines and converts the data to a character matrix.double
readDouble
(String prompt) Reads one token and converts it to a double-precision floating-point value.double[]
readDoubleArray
(String prompt) Reads one line, separates it into tokens and converts them to double-precision floating-point values.Double[]
readDoubleArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to double-precision floating-point values.readDoubleBoxed
(String prompt) Reads one token and converts it to a double-precision floating-point value.double[][]
readDoubleMatrix
(String prompt) Reads multiple lines and converts the data to a double-precision floating-point matrix.Double[][]
readDoubleMatrixBoxed
(String prompt) Reads multiple lines and converts the data to a double-precision floating-point matrix.float
Reads one token and converts it to a floating-point value.float[]
readFloatArray
(String prompt) Reads one line, separates it into tokens and converts them to floating-point values.Float[]
readFloatArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to floating-point values.readFloatBoxed
(String prompt) Reads one token and converts it to a floating-point value.float[][]
readFloatMatrix
(String prompt) Reads multiple lines and converts the data to a floating-point matrix.Float[][]
readFloatMatrixBoxed
(String prompt) Reads multiple lines and converts the data to a floating-point matrix.int
Reads one token and converts it to an integer value.int[]
readIntArray
(String prompt) Reads one line, separates it into tokens and converts them to integer values.Integer[]
readIntArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to integer values.readIntBoxed
(String prompt) Reads one token and converts it to an integer value.int[][]
readIntMatrix
(String prompt) Reads multiple lines and converts the data to an integer matrix.Integer[][]
readIntMatrixBoxed
(String prompt) Reads multiple lines and converts the data to an integer matrix.Reads a line of text and returns it as a string.Reads a line of text and returns it as a string.long
Reads one token and converts it to a long integer value.long[]
readLongArray
(String prompt) Reads one line, separates it into tokens and converts them to long integer values.Long[]
readLongArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to long integer values.readLongBoxed
(String prompt) Reads one token and converts it to a long integer value.long[][]
readLongMatrix
(String prompt) Reads multiple lines and converts the data to a long integer matrix.Long[][]
readLongMatrixBoxed
(String prompt) Reads multiple lines and converts the data to a long integer matrix.short
Reads one token and converts it to a short integer value.short[]
readShortArray
(String prompt) Reads one line, separates it into tokens and converts them to short integer values.Short[]
readShortArrayBoxed
(String prompt) Reads one line, separates it into tokens and converts them to short integer values.readShortBoxed
(String prompt) Reads one token and converts it to a short integer value.short[][]
readShortMatrix
(String prompt) Reads multiple lines and converts the data to a shot integer matrix.Short[][]
readShortMatrixBoxed
(String prompt) Reads multiple lines and converts the data to a shot integer matrix.Reads one token and returns it as a string value.String[]
readTokenArray
(String prompt) Reads one line, separates it into tokens and returns them as string values.String[][]
readTokenMatrix
(String prompt) Reads multiple lines and converts the data to a string matrix.void
setReadFromNewLine
(boolean readFromNewLine) Configures whether this reader should read input data from a new line or immediately after the displayed prompt.Methods inherited from class org.svetovid.io.DefaultSvetovidReader
close, doReadLine
Methods inherited from class org.svetovid.io.AbstractSvetovidReader
getLastException, getWhitespace, handleAnyException, handleFormatException, hasMore, isCharInNumber, isCharWhitespace, isCharWhitespaceOrSymbol, isEmpty, isThrowingExceptions, nextArray, nextChar, nextLiteral, nextNumber, nextPair, nextString, nextToken, nextValue, parseBool, parseChar, readAll, readAllLines, readBool, readBoolArray, readBoolArrayBoxed, readBoolBoxed, readBoolMatrix, readBoolMatrixBoxed, readByte, readByteArray, readByteArrayBoxed, readByteBoxed, readByteMatrix, readByteMatrixBoxed, readChar, readCharArray, readCharArrayBoxed, readCharBoxed, readCharMatrix, readCharMatrixBoxed, readDouble, readDoubleArray, readDoubleArrayBoxed, readDoubleBoxed, readDoubleMatrix, readDoubleMatrixBoxed, readFloat, readFloatArray, readFloatArrayBoxed, readFloatBoxed, readFloatMatrix, readFloatMatrixBoxed, readInt, readIntArray, readIntArrayBoxed, readIntBoxed, readIntMatrix, readIntMatrixBoxed, readLine, readLong, readLongArray, readLongArrayBoxed, readLongBoxed, readLongMatrix, readLongMatrixBoxed, readNextObject, readObject, readShort, readShortArray, readShortArrayBoxed, readShortBoxed, readShortMatrix, readShortMatrixBoxed, readToken, readTokenArray, readTokenMatrix, returnChar, setThrowingExceptions, setWhitespace, wrapUpIOException
-
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 orfalse
if it should do it immediately after the displayed prompt.
-
prompt
- Throws:
SvetovidIOException
-
readBool
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.out
.- Parameters:
prompt
- the message to prompt to the user- Returns:
- the
String
value read. - Throws:
SvetovidFormatException
- if the token isnull
.SvetovidIOException
- if an error occurred during the operation.
-
readBoolBoxed
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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 usingSvetovid.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
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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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
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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.out
. If an empty string is read, thedefaultValue
is returned.- Parameters:
prompt
- the message to prompt to the userdefaultValue
- 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, ordefaultValue
if the line was empty. - Throws:
SvetovidIOException
- if an error occurred during the operation.
-
readAllLines
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 usingSvetovid.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
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 usingSvetovid.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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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 usingSvetovid.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
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 usingSvetovid.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
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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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 usingSvetovid.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.
-