The cucs Package for Java
Version 1.2.0 (Released 6 September 1999)
[
Basic documentation
| Examples
| Source code
| Installing cucs
]
Overview
The cucs package for Java has been implemented at Clemson University to
facilitate the use of Java by students. The services provided by classes
in the cucs package make it easier to learn how to program in Java by
eliminating the need to learn many of the details and concepts that are
inherent in the standard Java libraries. For example, the cucs package
provides classes to do basic stream input by reading integers, reals,
and sequences of nonblank characters in addition to the character- and
line-oriented input provided in package java.io. There also are classes
that make it much easier to create GUIs than it is when only package
java.awt is used.
The classes that are currently provided in the cucs package are:
- BasicDataReader - A BasicDataReader object provides
the ability to read from a stream (standard input or a text file)
by requesting the next word, integer, double, or line from the
stream. (This is similar to stream input in other languages such
as C, C++, Ada, and Pascal.) The methods of the BasicDataReader
class throw no exceptions. Methods are provided to detect whether
end-of-file or an error occurred on the last input operation.
- DataReader - A DataReader object provides the
ability to read from a stream (standard input or a text file)
by requesting the next word, integer, double, or line from the
stream. (This is similar to stream input in other languages such
as C, C++, Ada, and Pascal.) Exceptions are thrown to indicate
end of file or invalid data.
- DataException - A DataException is thrown when bad input
data, such as an invalid string of characters for an integer or
double, is encountered in an input stream.
- BasicDataWriter - A BasicDataWriter object provides
text (byte) stream output without exceptions. An output value is
converted to String if needed, and written to the output file as a
stream of bytes. No separator is written between successive output
items. An output item can be an integer (int, long, etc.),
floating-point (double, float), or String value. The output stream
can be standard output or another file. Methods are provided to
detect whether an operation failed and to close the file.
- DataWriter - A DataWriter object provides
the same operations as for BasicDataWriter, but exceptions
are thrown for errors.
- Formatter - A Formatter object provides formatting operations
for numerical (integer and floating-point) and string data. A value
can be formatted as a string of any length, using left, center, or
right justification, and any nonnegative precision for floats.
- GUI - The GUI class is a superclass for simple GUI application
windows. It provides the functions of class WindowBase, plus it also
facilitates the management of buttons, text fields, and text areas in
an application GUI window.
- IntField - An IntField object is an input/output field in a
GUI that contains an int value. There are methods for setting and
retrieving the int value contained in an IntField.
- DoubleField - An DoubleField object is an input/output field
in a
GUI that contains a double value. There are methods for setting and
retrieving the double value contained in an DoubleField.
- WindowBase - The WindowBase class extends the Java AWT Frame
class. Thus it is intended to serve as the superclass for
an application window class. It provides basic window management
functions, such as disposing of the window when it is quit and
terminating the program, and it also provides the inset values for
the borders of the window.
- BasicInputDataReader - This class has been renamed
BasicDataReader, but it has been retained for upward compatibility.
- InputDataReader - This class has been renamed
DataReader, but it has been retained for upward compatibility.
- BasicOutputDataWriter - This class has been renamed
BasicDataWriter, but it has been retained for upward compatibility.
- OutputDataWriter - This class has been renamed
DataWriter, but it has been retained for upward compatibility.
Using the cucs package
To use (import) the cucs in a Java program, the cucs class library must be
in the class path. On the Clemson Department of Computer Science network
this is done by adding /pub/faculty/turner/javalib to the CLASSPATH
variable (which can be done, for example, by appending the command
setenv CLASSPATH ${CLASSPATH}:/pub/faculty/turner/javalib
to the end of the .cshrc file). The cucs package is installed on the Clemson
DCIT network, and no further action is needed to use it.
Versions
(The last version listed is the current version.)
- Initial version
- Class BasicInputDataReader
- Class InputDataReader
- Class DataException
- Class WindowBase
- Version 1.0
- Added class Formatter
- Version 1.1
- Added class BasicOutputDataWriter
- Added class OutputDataWriter
- Version 1.1.1
- Added flush(), checkError(), and writeLine methods to output writers.
- Fixed problem of ignoring blanks on readLine in input readers.
- Changed the readers (BasicInputDataReader, InputDataReader) to avoid
buffering on System.in to improve the interactive characteristics on
Dos
- Version 1.1.2
- Added the BasicDataReader, BasicDataWriter, DataReader, and DataWriter
classes (renamed from BasicInputDataReader, BasicOutputDataWriter,
InputDataReader, and OutputDataWriter).
Additional information
Last Modified: 6 September 1999