Package org.svetovid.io
Class AbstractSvetovidWriter
java.lang.Object
org.svetovid.io.AbstractSvetovidWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SvetovidWriter
- Direct Known Subclasses:
DefaultSvetovidWriter
This class provides default implementations for the
SvetovidWriter
interface. Standard behaviors of all methods are defined here. The developer
need only subclass this abstract class and define the
doPrint(String)
, doPrintln(String)
and doFlush()
methods.- Author:
- Ivan Pribela
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected final String
protected final String
protected final String
protected final String
protected final String
protected SvetovidIOException
protected final String
protected final String
protected final String
protected final String
protected final String
protected final String
protected boolean
protected final String
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendObject
(StringBuilder builder, String prefix, boolean printPrefix, Object value) void
close()
Closes this writer and releases any resources associated with the underlying stream.protected abstract void
doFlush()
protected abstract void
protected abstract void
boolean
Returns whether this writer automatically flushes the underlying output stream and forces any buffered output bytes to be written out after every operation by callingSvetovidWriter.printbf()
.Returns the exception raised in the last operation; if the operation was successful and no exception was raised, returnsnull
.Returns the currently used whitespace.boolean
Returns the indicator whether this writer will throw exceptions on I/O operation errors or just return default values.void
print()
Prints a whitespace.void
print
(boolean value) Prints a boolean value as a human readable string.void
print
(byte value) Prints a byte value as a human readable string.void
print
(char value) Prints a character value as a human readable string.void
print
(double value) Prints a double-precision floating-point value as a human readable string.void
print
(float value) Prints a floating-point value as a human readable string.void
print
(int value) Prints an integer value as a human readable string.void
print
(long value) Prints a long integer value as a human readable string.void
print
(short value) Prints a short integer value as a human readable string.void
Prints an object as a human readable string.void
Prints a string.void
printbf()
Prints any buffered data to the underlying output stream and then flushes that stream.void
Prints a formatted string using the specified format string and arguments.void
println()
Prints a line separator as defined by theline.separator
system property.void
println
(boolean value) Prints a boolean value and then terminates the line.void
println
(boolean... value) Prints all given boolean values in sequence separated by whitespace and then terminates the line.void
println
(boolean[][] value) Prints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
println
(byte value) Prints a byte value and then terminates the line.void
println
(byte... value) Prints all given byte values in sequence separated by whitespace and then terminates the line.void
println
(byte[][] value) Prints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
println
(char value) Prints a character value and then terminates the line.void
println
(char... value) Prints all given character values in sequence separated by whitespace and then terminates the line.void
println
(char[][] value) Prints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
println
(double value) Prints a double-precision floating-point value and then terminates the line.void
println
(double... value) Prints all given double-precision floating-point values in sequence separated by whitespace and then terminates the line.void
println
(double[][] value) Prints the given double-precision floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
println
(float value) Prints a floating-point value and then terminates the line.void
println
(float... value) Prints all given floating-point values in sequence separated by whitespace and then terminates the line.void
println
(float[][] value) Prints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
println
(int value) Prints an integer value and then terminates the line.void
println
(int... value) Prints all given integer values in sequence separated by whitespace and then terminates the line.void
println
(int[][] value) Prints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
println
(long value) Prints a long integer value and then terminates the line.void
println
(long... value) Prints all given long integer values in sequence separated by whitespace and then terminates the line.void
println
(long[][] value) Prints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
println
(short value) Prints a short integer value and then terminates the line.void
println
(short... value) Prints all given short integer values in sequence separated by whitespace and then terminates the line.void
println
(short[][] value) Prints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given boolean values in sequence separated by whitespace and then terminates the line.void
Prints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given byte values in sequence separated by whitespace and then terminates the line.void
Prints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given character values in sequence separated by whitespace and then terminates the line.void
Prints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given double-precision floating-point values in sequence separated by whitespace and then terminates the line.void
Prints the given double-precision floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given floating-point values in sequence separated by whitespace and then terminates the line.void
Prints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given integer values in sequence separated by whitespace and then terminates the line.void
Prints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given long integer values in sequence separated by whitespace and then terminates the line.void
Prints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints an object and then terminates the line.void
Prints all given objects in sequence separated by whitespace and then terminates the line.void
Prints the given object matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints all given short integer values in sequence separated by whitespace and then terminates the line.void
Prints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
Prints a string and then terminates the line.void
Prints all given string values in sequence separated by whitespace and then terminates the line.void
Prints the given string matrix row by row, each in the separate line, with the individual elements separated by whitespace.void
printObject
(Object value) Prints the given object in JSON (JavaScript Object Notation) format.void
setAutoFlush
(boolean autoFlush) Configures whether this writer should automatically flush the underlying output stream and force any buffered output bytes to be written out after every operation by callingSvetovidWriter.printbf()
.void
setThrowingExceptions
(boolean shouldThrow) Configures whether this writer should throw exceptions on I/O operation errors or just return default values.void
setWhitespace
(String whitespace) Sets the string used as whitespace.protected void
-
Field Details
-
whitespace
-
autoFlush
protected boolean autoFlush -
throwingExceptions
protected boolean throwingExceptions -
lastException
-
LINE_SEPARATOR
-
INDENT
- See Also:
-
LITERAL_NULL
- See Also:
-
LITERAL_TRUE
- See Also:
-
LITERAL_FALSE
- See Also:
-
STRING_QUOTE
- See Also:
-
BEGIN_OBJECT
-
END_OBJECT
- See Also:
-
BEGIN_ARRAY
-
END_ARRAY
- See Also:
-
NAME_SEPARATOR
- See Also:
-
VALUE_SEPARATOR
-
-
Constructor Details
-
AbstractSvetovidWriter
public AbstractSvetovidWriter()
-
-
Method Details
-
getWhitespace
Description copied from interface:SvetovidWriter
Returns the currently used whitespace. This whitespace is written by methods likeSvetovidWriter.print()
andSvetovidWriter.println(Object[])
.- Specified by:
getWhitespace
in interfaceSvetovidWriter
- Returns:
- the string currently used as whitespace.
-
setWhitespace
Description copied from interface:SvetovidWriter
Sets the string used as whitespace. This whitespace is written by methods likeSvetovidWriter.print()
andSvetovidWriter.println(Object[])
.- Specified by:
setWhitespace
in interfaceSvetovidWriter
- Parameters:
whitespace
- the string to use as whitespace
-
getAutoFlush
public boolean getAutoFlush()Description copied from interface:SvetovidWriter
Returns whether this writer automatically flushes the underlying output stream and forces any buffered output bytes to be written out after every operation by callingSvetovidWriter.printbf()
.- Specified by:
getAutoFlush
in interfaceSvetovidWriter
- Returns:
true
if this writer automatically flushes the underlying output stream;false
otherwise.
-
setAutoFlush
public void setAutoFlush(boolean autoFlush) Description copied from interface:SvetovidWriter
Configures whether this writer should automatically flush the underlying output stream and force any buffered output bytes to be written out after every operation by callingSvetovidWriter.printbf()
.- Specified by:
setAutoFlush
in interfaceSvetovidWriter
- Parameters:
autoFlush
- iftrue
this writer will callSvetovidWriter.printbf()
after every operation
-
isThrowingExceptions
public boolean isThrowingExceptions()Description copied from interface:SvetovidWriter
Returns the indicator whether this writer will throw exceptions on I/O operation errors or just return default values.- Specified by:
isThrowingExceptions
in interfaceSvetovidWriter
- Returns:
true
if this writer throws exceptions on failed I/O operations;false
otherwise.
-
setThrowingExceptions
public void setThrowingExceptions(boolean shouldThrow) Description copied from interface:SvetovidWriter
Configures whether this writer should throw exceptions on I/O operation errors or just return default values.- Specified by:
setThrowingExceptions
in interfaceSvetovidWriter
- Parameters:
shouldThrow
-true
if this writer should throw exceptions on failed I/O operations in the future;false
if it should return default values.
-
getLastException
Description copied from interface:SvetovidWriter
Returns the exception raised in the last operation; if the operation was successful and no exception was raised, returnsnull
.- Specified by:
getLastException
in interfaceSvetovidWriter
- Returns:
- the exception raised in the last operation or
null
it the operation was successful.
-
wrapUpIOException
- Throws:
SvetovidException
-
close
Description copied from interface:SvetovidWriter
Closes this writer and releases any resources associated with the underlying stream. The general contract ofclose
is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSvetovidWriter
- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a boolean value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Theboolean
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a byte value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Thebyte
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a short integer value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Theshort
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints an integer value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Theinteger
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a long integer value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Thelong
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a floating-point value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Thefloat
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a double-precision floating-point value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Thedouble
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a character value as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- Thecharacter
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a string. If the argument isnull
then the string"null"
is printed.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- TheString
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
doPrint
- Throws:
IOException
-
print
Description copied from interface:SvetovidWriter
Prints an object as a human readable string.- Specified by:
print
in interfaceSvetovidWriter
- Parameters:
value
- TheObject
to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriter
Prints a whitespace.- Specified by:
print
in interfaceSvetovidWriter
- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
printbf
Description copied from interface:SvetovidWriter
Prints any buffered data to the underlying output stream and then flushes that stream.- Specified by:
printbf
in interfaceSvetovidWriter
- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
doFlush
- Throws:
IOException
-
println
Description copied from interface:SvetovidWriter
Prints a boolean value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(boolean)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theboolean
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a byte value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(byte)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thebyte
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a short integer value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(short)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theshort
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints an integer value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(int)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theinteger
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a long integer value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(long)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thelong
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a floating-point value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(float)
and thenSvetovidWriter.println()
.SvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thefloat
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a double-precision floating-point value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(double)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thedouble
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a character value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(char)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thecharacter
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a string and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(String)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheString
value to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
doPrintln
- Throws:
IOException
-
println
Description copied from interface:SvetovidWriter
Prints an object and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(Object)
and thenSvetovidWriter.println()
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheObject
to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints a line separator as defined by theline.separator
system property.- Specified by:
println
in interfaceSvetovidWriter
- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given boolean values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(boolean)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theboolean
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given byte values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(byte)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thebyte
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given short integer values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(short)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theshort
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given integer values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(int)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theint
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given long integer values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(long)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thelong
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given floating-point values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(float)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thefloat
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given double-precision floating-point values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(double)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thedouble
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given character values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(char)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thechar
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given boolean values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheBoolean
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given byte values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheByte
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given short integer values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheShort
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given integer values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheInteger
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given long integer values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheLong
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given floating-point values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheFloat
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given double-precision floating-point values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheDouble
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given character values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.println(Object[])
.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheCharacter
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given string values in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(String)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheString
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints all given objects in sequence separated by whitespace and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(Object)
for each of the given values invokingSvetovidWriter.print()
in-between andSvetovidWriter.println()
at the end.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheObject
values to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theboolean
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thebyte
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theshort
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Theint
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thelong
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thefloat
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given double-precision floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thedouble
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- Thechar
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheBoolean
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheByte
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheShort
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheInteger
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheLong
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheFloat
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given double-precision floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheDouble
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheCharacter
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given string matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheString
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriter
Prints the given object matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
println
in interfaceSvetovidWriter
- Parameters:
value
- TheObject
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
printf
public void printf(String format, Object... arguments) throws SvetovidFormatException, SvetovidIOException Description copied from interface:SvetovidWriter
Prints a formatted string using the specified format string and arguments. For details seeFormatter
.- Specified by:
printf
in interfaceSvetovidWriter
- Parameters:
format
- A format string as described inFormatter
string syntax.arguments
- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The behavior on a null argument depends on the conversion.- Throws:
SvetovidFormatException
- If a format string isnull
, contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of theFormatter
class specification.SvetovidIOException
- if an error occurred during the operation.
-
printObject
Description copied from interface:SvetovidWriter
Prints the given object in JSON (JavaScript Object Notation) format.The object is printed using the following rules:
null
is printed as JSONnull
literal,- Boxed
true
andfalse
values are printed as JSON literalstrue
andfalse
respectively, Number
instances are printed as JSON number literals,String
values are printed as JSON string literals,- arrays and all
Iterable
s are printed as JSON arrays maintaining iteration order, Map
s are printed as JSON objects with each entry representing one member; map entries are printed in iteration order with the entry key as the member's name and entry value as the value,- All other objects are converted to strings using their {code toString()}.
- Specified by:
printObject
in interfaceSvetovidWriter
- Parameters:
value
- TheObject
matrix to be written- Throws:
SvetovidIOException
- if an error occurred during the operation.
-
appendObject
protected void appendObject(StringBuilder builder, String prefix, boolean printPrefix, Object value)
-