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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final Stringprotected final Stringprotected final Stringprotected final Stringprotected final Stringprotected SvetovidIOExceptionprotected final Stringprotected final Stringprotected final Stringprotected final Stringprotected final Stringprotected final Stringprotected booleanprotected final Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendObject(StringBuilder builder, String prefix, boolean printPrefix, Object value) voidclose()Closes this writer and releases any resources associated with the underlying stream.protected abstract voiddoFlush()protected abstract voidprotected abstract voidbooleanReturns 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.booleanReturns the indicator whether this writer will throw exceptions on I/O operation errors or just return default values.voidprint()Prints a whitespace.voidprint(boolean value) Prints a boolean value as a human readable string.voidprint(byte value) Prints a byte value as a human readable string.voidprint(char value) Prints a character value as a human readable string.voidprint(double value) Prints a double-precision floating-point value as a human readable string.voidprint(float value) Prints a floating-point value as a human readable string.voidprint(int value) Prints an integer value as a human readable string.voidprint(long value) Prints a long integer value as a human readable string.voidprint(short value) Prints a short integer value as a human readable string.voidPrints an object as a human readable string.voidPrints a string.voidprintbf()Prints any buffered data to the underlying output stream and then flushes that stream.voidPrints a formatted string using the specified format string and arguments.voidprintln()Prints a line separator as defined by theline.separatorsystem property.voidprintln(boolean value) Prints a boolean value and then terminates the line.voidprintln(boolean... value) Prints all given boolean values in sequence separated by whitespace and then terminates the line.voidprintln(boolean[][] value) Prints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidprintln(byte value) Prints a byte value and then terminates the line.voidprintln(byte... value) Prints all given byte values in sequence separated by whitespace and then terminates the line.voidprintln(byte[][] value) Prints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidprintln(char value) Prints a character value and then terminates the line.voidprintln(char... value) Prints all given character values in sequence separated by whitespace and then terminates the line.voidprintln(char[][] value) Prints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidprintln(double value) Prints a double-precision floating-point value and then terminates the line.voidprintln(double... value) Prints all given double-precision floating-point values in sequence separated by whitespace and then terminates the line.voidprintln(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.voidprintln(float value) Prints a floating-point value and then terminates the line.voidprintln(float... value) Prints all given floating-point values in sequence separated by whitespace and then terminates the line.voidprintln(float[][] value) Prints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidprintln(int value) Prints an integer value and then terminates the line.voidprintln(int... value) Prints all given integer values in sequence separated by whitespace and then terminates the line.voidprintln(int[][] value) Prints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidprintln(long value) Prints a long integer value and then terminates the line.voidprintln(long... value) Prints all given long integer values in sequence separated by whitespace and then terminates the line.voidprintln(long[][] value) Prints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidprintln(short value) Prints a short integer value and then terminates the line.voidprintln(short... value) Prints all given short integer values in sequence separated by whitespace and then terminates the line.voidprintln(short[][] value) Prints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given boolean values in sequence separated by whitespace and then terminates the line.voidPrints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given byte values in sequence separated by whitespace and then terminates the line.voidPrints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given character values in sequence separated by whitespace and then terminates the line.voidPrints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given double-precision floating-point values in sequence separated by whitespace and then terminates the line.voidPrints the given double-precision floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given floating-point values in sequence separated by whitespace and then terminates the line.voidPrints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given integer values in sequence separated by whitespace and then terminates the line.voidPrints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given long integer values in sequence separated by whitespace and then terminates the line.voidPrints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints an object and then terminates the line.voidPrints all given objects in sequence separated by whitespace and then terminates the line.voidPrints the given object matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints all given short integer values in sequence separated by whitespace and then terminates the line.voidPrints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidPrints a string and then terminates the line.voidPrints all given string values in sequence separated by whitespace and then terminates the line.voidPrints the given string matrix row by row, each in the separate line, with the individual elements separated by whitespace.voidprintObject(Object value) Prints the given object in JSON (JavaScript Object Notation) format.voidsetAutoFlush(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().voidsetThrowingExceptions(boolean shouldThrow) Configures whether this writer should throw exceptions on I/O operation errors or just return default values.voidsetWhitespace(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:SvetovidWriterReturns the currently used whitespace. This whitespace is written by methods likeSvetovidWriter.print()andSvetovidWriter.println(Object[]).- Specified by:
getWhitespacein interfaceSvetovidWriter- Returns:
- the string currently used as whitespace.
-
setWhitespace
Description copied from interface:SvetovidWriterSets the string used as whitespace. This whitespace is written by methods likeSvetovidWriter.print()andSvetovidWriter.println(Object[]).- Specified by:
setWhitespacein interfaceSvetovidWriter- Parameters:
whitespace- the string to use as whitespace
-
getAutoFlush
public boolean getAutoFlush()Description copied from interface:SvetovidWriterReturns 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:
getAutoFlushin interfaceSvetovidWriter- Returns:
trueif this writer automatically flushes the underlying output stream;falseotherwise.
-
setAutoFlush
public void setAutoFlush(boolean autoFlush) Description copied from interface:SvetovidWriterConfigures 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:
setAutoFlushin interfaceSvetovidWriter- Parameters:
autoFlush- iftruethis writer will callSvetovidWriter.printbf()after every operation
-
isThrowingExceptions
public boolean isThrowingExceptions()Description copied from interface:SvetovidWriterReturns the indicator whether this writer will throw exceptions on I/O operation errors or just return default values.- Specified by:
isThrowingExceptionsin interfaceSvetovidWriter- Returns:
trueif this writer throws exceptions on failed I/O operations;falseotherwise.
-
setThrowingExceptions
public void setThrowingExceptions(boolean shouldThrow) Description copied from interface:SvetovidWriterConfigures whether this writer should throw exceptions on I/O operation errors or just return default values.- Specified by:
setThrowingExceptionsin interfaceSvetovidWriter- Parameters:
shouldThrow-trueif this writer should throw exceptions on failed I/O operations in the future;falseif it should return default values.
-
getLastException
Description copied from interface:SvetovidWriterReturns the exception raised in the last operation; if the operation was successful and no exception was raised, returnsnull.- Specified by:
getLastExceptionin interfaceSvetovidWriter- Returns:
- the exception raised in the last operation or
nullit the operation was successful.
-
wrapUpIOException
- Throws:
SvetovidException
-
close
Description copied from interface:SvetovidWriterCloses this writer and releases any resources associated with the underlying stream. The general contract ofcloseis that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSvetovidWriter- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a boolean value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Thebooleanvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a byte value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Thebytevalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a short integer value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Theshortvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints an integer value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Theintegervalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a long integer value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Thelongvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a floating-point value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Thefloatvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a double-precision floating-point value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Thedoublevalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a character value as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- Thecharactervalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a string. If the argument isnullthen the string"null"is printed.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- TheStringvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
doPrint
- Throws:
IOException
-
print
Description copied from interface:SvetovidWriterPrints an object as a human readable string.- Specified by:
printin interfaceSvetovidWriter- Parameters:
value- TheObjectto be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
print
Description copied from interface:SvetovidWriterPrints a whitespace.- Specified by:
printin interfaceSvetovidWriter- Throws:
SvetovidIOException- if an error occurred during the operation.
-
printbf
Description copied from interface:SvetovidWriterPrints any buffered data to the underlying output stream and then flushes that stream.- Specified by:
printbfin interfaceSvetovidWriter- Throws:
SvetovidIOException- if an error occurred during the operation.
-
doFlush
- Throws:
IOException
-
println
Description copied from interface:SvetovidWriterPrints a boolean value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(boolean)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thebooleanvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints a byte value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(byte)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thebytevalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints a short integer value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(short)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Theshortvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints an integer value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(int)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Theintegervalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints a long integer value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(long)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thelongvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thefloatvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thedoublevalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints a character value and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(char)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thecharactervalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints a string and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(String)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheStringvalue to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
doPrintln
- Throws:
IOException
-
println
Description copied from interface:SvetovidWriterPrints an object and then terminates the line. This method behaves as though it invokesSvetovidWriter.print(Object)and thenSvetovidWriter.println().- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheObjectto be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints a line separator as defined by theline.separatorsystem property.- Specified by:
printlnin interfaceSvetovidWriter- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thebooleanvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thebytevalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Theshortvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Theintvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thelongvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thefloatvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thedoublevalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- Thecharvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheBooleanvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheBytevalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheShortvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheIntegervalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheLongvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheFloatvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheDoublevalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheCharactervalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheStringvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints 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:
printlnin interfaceSvetovidWriter- Parameters:
value- TheObjectvalues to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thebooleanmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thebytematrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Theshortmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Theintmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thelongmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thefloatmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given double-precision floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thedoublematrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- Thecharmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given boolean matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheBooleanmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given byte matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheBytematrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given short integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheShortmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheIntegermatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given long integer matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheLongmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheFloatmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given double-precision floating-point matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheDoublematrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given character matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheCharactermatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given string matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheStringmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
println
Description copied from interface:SvetovidWriterPrints the given object matrix row by row, each in the separate line, with the individual elements separated by whitespace.- Specified by:
printlnin interfaceSvetovidWriter- Parameters:
value- TheObjectmatrix 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:SvetovidWriterPrints a formatted string using the specified format string and arguments. For details seeFormatter.- Specified by:
printfin interfaceSvetovidWriter- Parameters:
format- A format string as described inFormatterstring 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 theFormatterclass specification.SvetovidIOException- if an error occurred during the operation.
-
printObject
Description copied from interface:SvetovidWriterPrints the given object in JSON (JavaScript Object Notation) format.The object is printed using the following rules:
nullis printed as JSONnullliteral,- Boxed
trueandfalsevalues are printed as JSON literalstrueandfalserespectively, Numberinstances are printed as JSON number literals,Stringvalues are printed as JSON string literals,- arrays and all
Iterables are printed as JSON arrays maintaining iteration order, Maps 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:
printObjectin interfaceSvetovidWriter- Parameters:
value- TheObjectmatrix to be written- Throws:
SvetovidIOException- if an error occurred during the operation.
-
appendObject
protected void appendObject(StringBuilder builder, String prefix, boolean printPrefix, Object value)
-