NeatToolsModule
The NeatToolsModule is the NeatTools specialization of the
the WebFlowModule. The NeatToolsModule is the abstract base
class of all NeatTools modules.
The NeatToolsApplication run-time environment consists of a set of NeatToolsModules,
without any knowledge of the specific module types.
For example, the code which runs a NeatTools program is simply:
for each module
module.update()
Data types
Input and output streams are typed, and connections can only be made between
compatible streams. The current data types are:
- line, line-by-line input
- string, string input
- byte stream, values provided in 8 bit units
- int stream, values provided in 32 bit units
- boolean stream, values provided are either true or false.
In addition to like types, the following connections are compatible:
- byte to int
- string to line
Fixed Value streams
In some cases, it is useful to provide streams which only generate a single
fixed value. For example, if a particular module is using a boolean stream
as a control signal, the user may wish to have this signal be always on. This
can be done by creating an instance of a FixedValueInput. There is one
type of FixedValueInput for each data type.
Another use of these is as configuration values for modules.
Using a set of fixed value streams as inputs for a module simplifies the code generation,
and allows a simple tool to be used to create the start up values required by
the module. For example, the FileInput module uses a FixedString input to indicate
the file name. In the initial prototype, all fixed value inputs must be explicitly
indicated.
Input and Output Streams
The number and type of input and output streams are predetermined by each
specific module type. Both are derived from the same base class. The only difference
between them is the ability to associate. An output stream may be associated with
any number of compatible input streams.
An association between an output and input stream causes the output stream to make
its data available to the input stream. This is done by simply copying the data from
the output stream to the input stream(s).
When a module's update method executes,
it reads from its input streams, does some specialized processing, then
places information in its output streams. The output
stream is then responsible for updating its associated inputs.
The input and output streams described here are not derived from Java InputStream
and OutputStream. There are two reasons for this:
- One output stream may be connected to many input streams.
- One input stream (see for example
FramedInput devices) may be used to update several independent
output streams.
Fields
- inputStreams - the list of InputStreams available for the module.
- outputStreams - the list of OutputStreams available for the module.
Methods
- abstract public void update() -- performs the transformation of input
streams into output streams.