EDOBE XDOM PMML Manual de usuario Pagina 28

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 98
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 27
28
EXAMPLE: COPYING INPUTS
This section presents a simple example of the steps needed to create a
new node. We will create a node that simply copies data from its
inputs to its outputs. While the computation involved is trivial, this
will show what’s involved in creating a node.
We begin with an implementation involving no parameters and
written completely in Java. Later extensions include computation
performed in C++ and a dialog to pass parameters.
For all of the examples presented here, the full code is available in the
examples/programming directory.
Simple Java
Version
For the first implementation, we will use a minimal set of Java classes.
Recall that typically we will need to implement a class extending
ActivityNodeModel to handle GUI operations, a class extending
EngineNode to handle engine operations, and possibly other classes
for the properties dialog and custom viewer.
Node Model To keep things simple we will not include a properties dialog or
custom viewer. As there are no parameters, we do not need to
validate whether all of the properties are set. In this case we can use
the default implementation of
ActivityNodeModel.
Engine Node The Java implementation of the engine node will primarily need
computation-specific code for computing the output column name
and type information (the output metadata) and for actually copying
the data when the node is executed. In addition, there will be some
essentially boilerplate code.
We start with a simple implementation of the
execute() and
calculateOutputMetaData() methods. Later we will provide more
extensive implementations.
Implementation
The file
FirstCopyEngineNode.java contains:
import com.insightful.miner.*;
import com.insightful.cnkjava.*;
Vista de pagina 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 97 98

Comentarios a estos manuales

Sin comentarios