Class Svetovid
java.lang.Object
Svetovid
This is a utility class that serves as an easy access point to various
functionalities of Svetovid library.
The main functionalities provided are readers and writers for standard input
and output streams and file access, as well as graphical user interface
message boxes and dialogs.
- Author:
- Ivan Pribela
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StandardSvetovidErrorWriterThe "standard" error output.static AutoCloseDialogFactoryThe graphical user interface factory used to create and show message and dialog boxes.static StandardSvetovidReaderThe "standard" input.static StandardSvetovidWriterThe "standard" output. -
Method Summary
Modifier and TypeMethodDescriptionstatic SvetovidWriterThe output writer that will append data to the given target.static SvetovidReaderCloses the reader (if any) and releases any resources associated with the given source.static SvetovidWriterCloses the writer (if any) and releases any resources associated with the given target.static SvetovidReaderThe input reader for the given source.static voidThe main method just prints out the version number.static SvetovidWriterThe output writer for the given target.static SvetovidWriterThe output writer that will optionally append data to the given target.static booleantestAppend(String target) Checks whether the data can be appended to the given target.static booleanChecks whether the given source can be used for input.static booleanChecks whether the given target can be used for output.static booleanChecks whether the given target can be used for output.
-
Field Details
-
in
The "standard" input. This reader is already open and ready to supply input data. Typically this stream corresponds to keyboard input or another input source specified by the host environment or user. -
out
The "standard" output. This writer is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user. -
err
The "standard" error output. This writer is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user. By convention, this output stream is used to display error messages or other information that should come to the immediate attention of a user even if the principal output stream, the value of the variableout, has been redirected to a file or other destination that is typically not continuously monitored. -
gui
The graphical user interface factory used to create and show message and dialog boxes.
-
-
Method Details
-
testIn
Checks whether the given source can be used for input.- Parameters:
source- a string describing the source- Returns:
trueif the given source can be read;falseotherwise.
-
testOut
Checks whether the given target can be used for output.- Parameters:
target- a string describing the target- Returns:
trueif it is possible to write to the given target;falseotherwise.
-
testAppend
Checks whether the data can be appended to the given target.- Parameters:
target- a string describing the target- Returns:
trueif it is possible to append data to the given target;falseotherwise.
-
testOut
Checks whether the given target can be used for output.- Parameters:
target- a string describing the targetappend-trueto check if the data can be appended to the target;falseto check if the data can be overwritten- Returns:
trueif it is possible to write to the given target;falseotherwise.
-
in
The input reader for the given source. The returned reader is already open and ready to supply input data. If the supplied source string is a file name, the returned reader will correspond to that file. If the source is a url the reader will read the resource identified by that url. Otherwise, the returned reader will correspond to the standard input stream.- Parameters:
source- a string describing the source- Returns:
- a
SvetovidReaderthat can be used to read from the desired source.
-
out
The output writer for the given target. The returned writer is already open and ready to accept output data. If the supplied target string is a file name, the returned writer will correspond to that file; otherwise it will correspond to the standard output stream.- Parameters:
target- a string describing the writter's target- Returns:
- a
SvetovidWriterthat can be used to write to the desired target.
-
append
The output writer that will append data to the given target. The returned writer is already open and ready to accept output data. If the supplied target string is a file name, the returned writer will correspond to that file; otherwise it will correspond to the standard output stream.- Parameters:
target- a string describing the writter's target- Returns:
- a
SvetovidWriterthat can be used to write to the desired target.
-
out
The output writer that will optionally append data to the given target. The returned writer is already open and ready to accept output data. If the supplied target string is a file name, the returned writer will correspond to that file; otherwise it will correspond to the standard output stream.- Parameters:
target- a string describing the writter's targetappend- should the data be appended to the given target or not- Returns:
- a
SvetovidWriterthat can be used to write to the desired target.
-
closeIn
Closes the reader (if any) and releases any resources associated with the given source.- Parameters:
source- the source for which to close the reader- Returns:
- the closed reader.
- Throws:
SvetovidIOException- if an error occurred during the operation.
-
closeOut
Closes the writer (if any) and releases any resources associated with the given target.- Parameters:
target- the target for which to close the writer- Returns:
- the closed writer.
- Throws:
SvetovidIOException- if an error occurred during the operation.
-
main
The main method just prints out the version number.- Parameters:
args- this argument is just ignored
-